高斯分布(Gaussian Distribution)的概率密度函數(probability density function):
\[f(x)=\frac1{\sqrt{2\pi}\sigma}\exp(-\frac{(x-\mu)^2}{2\sigma^2}) \]
對應於numpy中:
numpy.random.normal(loc=0.0, scale=1.0, size=None)
參數的意義為:
loc:float
此概率分布的均值(對應着整個分布的中心centre)
scale:float
此概率分布的標准差(對應於分布的寬度,scale越大越矮胖,scale越小,越瘦高)
size:int or tuple of ints
輸出的shape,默認為None,只輸出一個值
我們更經常會用到的np.random.randn(size)所謂標准正態分布(μ=0,σ=1μ=0,σ=1)
,對應於np.random.normal(loc=0, scale=1, size)
。