summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-09-06 10:39:13 +0200
committerGitHub <noreply@github.com>2022-09-06 10:39:13 +0200
commit35cfcacb40cda04ca9537162f83f95dd3db1bd9d (patch)
tree58435870b7cfce8d81cded7dcfe795c792402530 /numpy/random
parent63bec252a76bb13d739de20ae9c4732bfa7c3129 (diff)
parent7a3066c39002404e5c0b7ff316317604ef3f603b (diff)
downloadnumpy-35cfcacb40cda04ca9537162f83f95dd3db1bd9d.tar.gz
Merge pull request #22171 from MatteoRaso/bug_fix
DOC: Note symmetry requirement in `multivariate_normal` error
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/_generator.pyx4
-rw-r--r--numpy/random/mtrand.pyx4
2 files changed, 4 insertions, 4 deletions
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx
index da8ab64e2..6af101ed9 100644
--- a/numpy/random/_generator.pyx
+++ b/numpy/random/_generator.pyx
@@ -3736,10 +3736,10 @@ cdef class Generator:
psd = not np.any(s < -tol)
if not psd:
if check_valid == 'warn':
- warnings.warn("covariance is not positive-semidefinite.",
+ warnings.warn("covariance is not symmetric positive-semidefinite.",
RuntimeWarning)
else:
- raise ValueError("covariance is not positive-semidefinite.")
+ raise ValueError("covariance is not symmetric positive-semidefinite.")
if method == 'cholesky':
_factor = l
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx
index 5672ed60b..7edd98351 100644
--- a/numpy/random/mtrand.pyx
+++ b/numpy/random/mtrand.pyx
@@ -4177,11 +4177,11 @@ cdef class RandomState:
psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
if not psd:
if check_valid == 'warn':
- warnings.warn("covariance is not positive-semidefinite.",
+ warnings.warn("covariance is not symmetric positive-semidefinite.",
RuntimeWarning)
else:
raise ValueError(
- "covariance is not positive-semidefinite.")
+ "covariance is not symmetric positive-semidefinite.")
x = np.dot(x, np.sqrt(s)[:, None] * v)
x += mean