This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: multivariate gaussian distribution (Code)
- From: Przemyslaw Sliwa <sliwa at euv-frankfurt-o dot de>
- To: <ebenazer at email dot arc dot nasa dot gov>
- Cc: <gsl-discuss at sources dot redhat dot com>
- Date: Tue, 30 Dec 2003 11:55:16 +0100 (MET)
- Subject: Re: multivariate gaussian distribution (Code)
- References: <20031229233500.GF5259@wow.arc.nasa.gov>
Hi Emmanuel,
You do not have to implement the cholesky method. It has been already
implented. I gave you some C code.
I do not know how people do it in R. But as I said in the previous
posting. The Cholesky decomposition is very effifcient method and has been
already implemented within the GSL framework. If you use the
Eigendecomposition it might happen that someone inputs a covariance matrix
which is not positive definite (imdefinite?). In this case the
eigendecomposition will still work witout signaling any errors. I have no
idea what will be the result if you generate the random vectors. Probably
they will be normally distributed with imdefinite covariance matrix which
is a very bad case. The Cholesky decomp. will fail in this case indicating
an error.
But it is up to you what you want to do. I am just saying there are
methods better than the Eigen with inefficient code. The same about the LU
decomposition.
kind regards,
Przem
> It is easy to implement the Cholesky method. I'll do it if
> people are interested.
>
> Once again though, the R statistical package
> (that is a well-known library) uses the eigenvalues decomposition:
> http://rweb.stat.umn.edu/R/library/MASS/html/mvrnorm.html
>
> Please take time to read the messages !
>
> Emmanuel