python高斯分布概率密度函數(shù)的使用詳解
更新時(shí)間:2019年07月10日 09:59:04 作者:aespresso
今天小編就為大家分享一篇python高斯分布概率密度函數(shù)的使用詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
如下所示:
import matplotlib.pyplot as plt import numpy as np from scipy import stats from matplotlib import style style.use('fivethirtyeight') mu_params = [-1, 0, 1] sd_params = [0.5, 1, 1.5] x = np.linspace(-7, 7, 100) f, ax = plt.subplots(len(mu_params), len(sd_params), sharex=True, sharey=True, figsize=(12,8)) for i in range(3): for j in range(3): mu = mu_params[i] sd = sd_params[j] y = stats.norm(mu, sd).pdf(x) ax[i, j].plot(x, y) ax[i, j].plot(0,0, label='mu={:3.2f}\nsigma={:3.2f}'.format(mu,sd), alpha=0) ax[i, j].legend(fontsize=10) ax[2,1].set_xlabel('x', fontsize=16) ax[1,0].set_ylabel('pdf(x)', fontsize=16) plt.suptitle('Gaussian PDF', fontsize=16) plt.tight_layout() plt.show()
以上這篇python高斯分布概率密度函數(shù)的使用詳解就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
python2.7使用scapy發(fā)送syn實(shí)例
這篇文章主要介紹了python2.7使用scapy發(fā)送syn實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-05-05利用OpenCV中對(duì)圖像數(shù)據(jù)進(jìn)行64F和8U轉(zhuǎn)換的方式
這篇文章主要介紹了利用OpenCV中對(duì)圖像數(shù)據(jù)進(jìn)行64F和8U轉(zhuǎn)換的方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-06-06python使用pygame框架實(shí)現(xiàn)推箱子游戲
這篇文章主要為大家詳細(xì)介紹了python使用pygame框架實(shí)現(xiàn)推箱子游戲,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-11-11python中如何使用正則表達(dá)式提取數(shù)據(jù)
這篇文章主要介紹了python中如何使用正則表達(dá)式提取數(shù)據(jù)問題。具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-02-02python數(shù)據(jù)挖掘需要學(xué)的內(nèi)容
在本篇文章中我們給大家整理了關(guān)于python數(shù)據(jù)挖掘需要學(xué)什么的知識(shí)點(diǎn)指南,有興趣的朋友們跟著參考下。2019-06-06