Skip to content

Commit

Permalink
Merge pull request numpy#5266 from chebee7i/multivariate_normal
Browse files Browse the repository at this point in the history
Possible regression in `multivariate_normal()`
  • Loading branch information
charris committed Nov 11, 2014
2 parents 265fbe1 + fa30605 commit b36ecba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions numpy/random/mtrand/mtrand.pyx
Expand Up @@ -2919,7 +2919,7 @@ cdef class RandomState:
Plot Gaussian for comparison:
>>> g = (1/(scale * np.sqrt(2 * np.pi)) *
>>> g = (1/(scale * np.sqrt(2 * np.pi)) *
... np.exp(-(x - loc)**2 / (2 * scale**2)))
>>> plt.plot(x,g)
Expand Down Expand Up @@ -4220,8 +4220,8 @@ cdef class RandomState:
mean : 1-D array_like, of length N
Mean of the N-dimensional distribution.
cov : 2-D array_like, of shape (N, N)
Covariance matrix of the distribution. Must be symmetric and
positive-semidefinite for "physically meaningful" results.
Covariance matrix of the distribution. It must be symmetric and
positive-semidefinite for proper sampling.
size : int or tuple of ints, optional
Given a shape of, for example, ``(m,n,k)``, ``m*n*k`` samples are
generated, and packed in an `m`-by-`n`-by-`k` arrangement. Because
Expand Down Expand Up @@ -4268,7 +4268,9 @@ cdef class RandomState:
>>> x,y = np.random.multivariate_normal(mean,cov,5000).T
>>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
Note that the covariance matrix must be non-negative definite.
Note that the covariance matrix must be positive semidefinite (a.k.a.
nonnegative-definite). Otherwise, the behavior of this method is
undefined and backwards compatibility is not guaranteed.
References
----------
Expand Down

0 comments on commit b36ecba

Please sign in to comment.