[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
-------------------------------------------------------------
- Multivariate pdf of a normal distribution, Gorazd Brumen, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Paul Kienzle, 2005/11/05
- Re: Multivariate pdf of a normal distribution,
Mike Miller <=
- Re: Multivariate pdf of a normal distribution, Paul Kienzle, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Mike Miller, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Prasenjit Kapat, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Mike Miller, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Prasenjit Kapat, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Paul Kienzle, 2005/11/05
- Re: Multivariate pdf of a normal distribution, Mike Miller, 2005/11/06
Re: Multivariate pdf of a normal distribution, Michael Creel, 2005/11/07