[SciPy-user] How to generate random positive definite matrix

Anne Archibald peridot.faceted@gmail....
Mon Jun 11 14:05:41 CDT 2007

On 11/06/07, David Cournapeau <david@ar.media.kyoto-u.ac.jp> wrote:

> Yes, I need them to as parameters of multivariate gaussian. so they need
> to be real, not hermitian.

Oh, I forgot to say: I wrote a multivariate Gaussian random number
generator (takes a covariance matrix as input) and some tools to
compare covariance matrices. They're not perfect (in particular the
testing is a bit limited) but if they come in handy I'd be happy to
put them under a BSD license or contribute them to scipy.

> > Now, a sort-of interesting question is, is there a natural
> > distribution on the cone of positive definite matrices one could hope
> > to draw from?
> Well, we could draw samples from  a Wishart, but I was too lazy to
> implement it. It is definitely "natural", specially for multivariate
> normal, but I need to improve my knowledge on multidimensional calculus
> before being able to understand them (and implement them, hopefully).

The Wishart distribution has too many parameters to really be natural,
to my taste. (I suppose there is a technical definition of natural in
terms of category theory, and I bet in the right setting it could be
shown to be natural.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: covariance.py
Type: text/x-python
Size: 1834 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20070611/08bdd498/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_covariance.py
Type: text/x-python
Size: 2452 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20070611/08bdd498/attachment-0001.py 

More information about the SciPy-user mailing list