# [Numpy-discussion] pdf for multivariate normal function?

Andrew Jaffe a.h.jaffe@gmail....
Thu Jul 23 10:42:48 CDT 2009

```Hi,

Charles R Harris wrote:
>
> On Thu, Jul 23, 2009 at 7:14 AM, per freem <perfreem@gmail.com
> <mailto:perfreem@gmail.com>> wrote:
>
>     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?
>
> Well, what does a pdf mean in the multidimensional case? One way to
> convert the density function into a Stieltjes type measure is to plot
> the integral over a polytope with one corner at [-inf, -inf,....] and
> the diagonally opposite corner at the plotting point, but the
> multidimensional display of the result might not be very informative.
> What do you actually want here?

You are confusing PDF (Probability Density Functions) with CDF
(Cumulative Density Function), I think. The PDF is well-defined for
multivariate distributions. It is defined so that P(x) dx is the
probability to be in the infinitesimal range (x,x+dx).

For a multivariate gaussian, it's

P(x|m, C) = [1/det(2 pi C)] exp{ -1/2 (x-m)^T C^{-1} (x-m) }

in matrix notation, where m is the mean and C is the covariance matrix.

Andrew

```