[英]Numpy's Multivariate Normal example is not clear
I am not sure if this question fits to numpy users or mathematicians.我不确定这个问题是否适合 numpy 用户或数学家。 I don't understand how the numpy.random.multivariate_normal example works.
我不明白numpy.random.multivariate_normal示例是如何工作的。
In the bottom of the documentation, it generates a few random values given a mean and covariance matrix,在文档的底部,它会生成一些给定均值和协方差矩阵的随机值,
mean = (1, 2)
cov = [[1, 0], [0, 1]]
x = np.random.multivariate_normal(mean, cov, (3, 3))
and then says:然后说:
The following is probably true, given that 0.6 is roughly twice the standard deviation.
以下可能是正确的,因为 0.6 大约是标准偏差的两倍。
I understand that this is coming from the empirical rule but I don't know how the standard deviation is 0.3.我知道这是来自 经验规则,但我不知道标准偏差是 0.3。
Can anyone help me through this?谁能帮我解决这个问题?
The sentence you refer to, refers to the property of a normal distribution in general ( enter link description here ),您所指的句子通常是指正态分布的属性( 在此处输入链接描述),
and not to some NumPy
-specific functionality.而不是某些
NumPy
特定的功能。 As you normalize the samples you ger, ie, reduce the mean, the distribution is shifted around 0
, and given that the std
of the samples is 0.3
, than most of the samples will be generated in range which is less than 3*0.3 = 0.9
from the mean, viz.当您对您的样本进行归一化时,即减少平均值时,分布会在
0
附近移动,并且假设样本的std
为0.3
,那么大多数样本将在小于3*0.3 = 0.9
的范围内生成3*0.3 = 0.9
从平均值,即。 0, with the following proportion: 0,比例如下:
so, it follows that roughly 95% of the times the X you get in the vector you produce will be smaller than 0.6, if the std=0.3
.因此,如果
std=0.3
,您在生成的向量中获得的 X 大约有 95% 的时间小于 0.6。
Cheers干杯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.