I am not sure if this question fits to numpy users or mathematicians. I don't understand how the numpy.random.multivariate_normal's example works.
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.
list((x[0,0,:] - mean) < 0.6)
I understand that this is coming from the empirical rule but I don't know how the standard deviation is 0.3. Given that the variance is 1 in each axis, the std (square root of variance) should be 1 too, not 0.3.
Moreover, for multivariate variables, this 95% rule doesn't hold anymore.
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. As you normalize the samples you ger, i.e., reduce the mean, the distribution is shifted around0, and given that thestdof the samples is0.3, than most of the samples will be generated in range which is less than3*0.3 = 0.9from the mean, viz. 0, with the following proportion: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.Cheers