[Numpy-discussion] pdf for multivariate normal function?

David Cournapeau david at ar.media.kyoto-u.ac.jp
Thu Jul 23 22:54:55 EDT 2009


per freem wrote:
> hi all,
>
> i'm trying to find the function for the pdf of a multivariate normal
> pdf. i know that the function "multivariate_normal" can be used to
> sample from the multivariate normal distribution, but i just want to
> get the pdf for a given vector of means and a covariance matrix. is
> there a function to do this?

AFAIK, there is no such function in scipy. There is one in the em
subpackage of the learn scikits. The file which implements it is
self-contained, so you could use this in the meantime:

http://projects.scipy.org/scikits/browser/trunk/learn/scikits/learn/machine/em/densities.py

I wrote this code some time ago, so it is not optimal in various ways,
but it should get the job done.

cheers,

David



More information about the NumPy-Discussion mailing list