summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-03-13 15:50:03 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-03-22 17:34:41 -0600
commitd36f81372229aac3455dcb69b784e1363d290239 (patch)
tree102854f167cc3b7d805c02c054e14f41ef96723c /numpy/lib/tests/test_function_base.py
parent2b984294e98a7cf1e60455cf9022ca7b7e6a7a84 (diff)
downloadnumpy-d36f81372229aac3455dcb69b784e1363d290239.tar.gz
ENH, MAINT: Check that covariance is positive-semidefinite.
numpy.random.multivariate_normal uses SVD to obtain the covariance square root, but the result will be incorrect if the covariance is not positive-semidefinite and no warning will be given. However, a check can be made even while using the SVD by checking if the rows of u.T and v have the same sign, where u and v are given by u, d, v = svd(a). A deprecation warning is also fixed. When the default size was used an empty list was passed to multiply.reduce, which resulted in a default float 1. for a shape index. That is no longer legal. The problem is fixed by using an array reshape, which also avoids potential overflow in the original computation. Closes #4489.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
0 files changed, 0 insertions, 0 deletions