help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multivariate pdf of a normal distribution


From: Mike Miller
Subject: Re: Multivariate pdf of a normal distribution
Date: Sat, 5 Nov 2005 16:10:14 -0600 (CST)

On Sat, 5 Nov 2005, Paul Kienzle wrote:

The math looks pretty easy to implement:

        http://www.itl.nist.gov/div898/handbook/pmc/section5/pmc542.htm

Using Cholesky factorization on the positive definite covariance matrix:

why not this?:

density = mvnorm_pdf(x, mu, Sigma)

# first check array sizes, but I'm skipping that

p = length(x);

density = (2*pi)^(-p/2) * (1/sqrt(det(Sigma))) * 
exp(-.5*(x-mu)'*inv(Sigma)*(x-mu));


Of course, the density goes to infinity when Sigma is singular. Is your use of chol() just meant to check that the matrix is PD?


Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]