[Numpy-discussion] strange behavior of numpy.random.multivariate_normal, ticket:1842
Pierre Haessig
pierre.haessig@crans....
Thu Feb 16 10:12:36 CST 2012
Le 16/02/2012 16:20, josef.pktd@gmail.com a écrit :
> I don't see any way to fix multivariate_normal for this case, except
> for dropping svd or for random perturbing a covariance matrix with
> multiplicity of singular values.
Hi,
I just made a quick search in what R guys are doing. It happens there
are several codes (http://cran.r-project.org/web/views/Multivariate.html
). For instance, mvtnorm
(http://cran.r-project.org/web/packages/mvtnorm/index.html). I've
attached the related function from the source code of this package.
Interestingly enough, it seems they provide 3 different methods (svd,
eigen values, and Cholesky).
I don't have the time now to dive in the assessments of pros and cons of
those three. Maybe one works for our problem, but I didn't check yet.
Pierre
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mvnorm_from_mvtnorm.R
Url: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120216/f0803d73/attachment.pl
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mvrnorm_from_MASS.R
Url: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120216/f0803d73/attachment-0001.pl
More information about the NumPy-Discussion
mailing list