This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: multivariate gaussian distribution (Code)


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]