* multivariate gaussian distribution
@ 2003-12-20 11:10 Emmanuel Benazera
2003-12-22 14:21 ` Brian Gough
0 siblings, 1 reply; 6+ messages in thread
From: Emmanuel Benazera @ 2003-12-20 11:10 UTC (permalink / raw)
To: gsl-discuss
Hi,
I've written a few lines of code that implement a multivariate
gaussian distribution. The function takes the eigenvalues/vectors
decomposition of the covariance matrix as input, and outputs a
random vector. In dimension n, it proceeds to n gsl_ran_gaussian
calls, plus a blas level 2 product. It fits in the GSL framework.
I guess it may be useful to other GSL users. Should it be added
to the library ? I can provide the piece of code + doc + theoretical
reference.
Regards,
Emmanuel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multivariate gaussian distribution
2003-12-20 11:10 multivariate gaussian distribution Emmanuel Benazera
@ 2003-12-22 14:21 ` Brian Gough
2003-12-28 10:29 ` multivariate gaussian distribution (Code) Emmanuel Benazera
0 siblings, 1 reply; 6+ messages in thread
From: Brian Gough @ 2003-12-22 14:21 UTC (permalink / raw)
To: Emmanuel Benazera; +Cc: gsl-discuss
Emmanuel Benazera writes:
> I've written a few lines of code that implement a multivariate
> gaussian distribution. The function takes the eigenvalues/vectors
> decomposition of the covariance matrix as input, and outputs a
> random vector. In dimension n, it proceeds to n gsl_ran_gaussian
> calls, plus a blas level 2 product. It fits in the GSL framework.
>
> I guess it may be useful to other GSL users. Should it be added
> to the library ? I can provide the piece of code + doc + theoretical
> reference.
Certainly feel free to send it to the list or post it on a webpage
somewhere.
--
Brian Gough
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multivariate gaussian distribution (Code)
2003-12-22 14:21 ` Brian Gough
@ 2003-12-28 10:29 ` Emmanuel Benazera
2003-12-29 11:41 ` Brian Gough
0 siblings, 1 reply; 6+ messages in thread
From: Emmanuel Benazera @ 2003-12-28 10:29 UTC (permalink / raw)
To: gsl-discuss
[-- Attachment #1: Type: text/plain, Size: 65 bytes --]
Hi,
here is a tarball. Hope it helps.
Happy holidays,
Emmanuel
[-- Attachment #2: gsl_mvg.tar.gz --]
[-- Type: application/x-tar-gz, Size: 59845 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multivariate gaussian distribution (Code)
2003-12-28 10:29 ` multivariate gaussian distribution (Code) Emmanuel Benazera
@ 2003-12-29 11:41 ` Brian Gough
2003-12-29 16:47 ` Emmanuel Benazera
2004-04-28 8:08 ` multivariate gaussian distribution (Code) / bugfix Emmanuel Benazera
0 siblings, 2 replies; 6+ messages in thread
From: Brian Gough @ 2003-12-29 11:41 UTC (permalink / raw)
To: Emmanuel Benazera; +Cc: gsl-discuss
Emmanuel Benazera writes:
> Hi,
>
> here is a tarball. Hope it helps.
>
Is there any advantage of LU over Cholesky decomposition?
--
Brian Gough
Network Theory Ltd
15 Royal Park
Bristol BS8 3AL
United Kingdom
Tel: +44 (0)117 3179309
Fax: +44 (0)117 9048108
Web: http://www.network-theory.co.uk/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multivariate gaussian distribution (Code)
2003-12-29 11:41 ` Brian Gough
@ 2003-12-29 16:47 ` Emmanuel Benazera
2004-04-28 8:08 ` multivariate gaussian distribution (Code) / bugfix Emmanuel Benazera
1 sibling, 0 replies; 6+ messages in thread
From: Emmanuel Benazera @ 2003-12-29 16:47 UTC (permalink / raw)
To: Brian Gough; +Cc: Emmanuel Benazera, gsl-discuss
Hi Brian,
I remember reading that the matrix decomposition through
eigensystems was more 'stable', while Cholesky was
probably faster. See the implementation in R:
http://rweb.stat.umn.edu/R/library/MASS/html/mvrnorm.html
I used the LU for determinant and matrix inverse only.
I'm not an expert in this field though...
Emmanuel
P.S.: in my opinion the multivariate_gaussian_pdf_LU is rather
useless, because for repeated calls, you want the inverse
to be computed once and for all.
On Mon, Dec 29, 2003 at 11:41:10AM +0000, Brian Gough wrote:
> Emmanuel Benazera writes:
> > Hi,
> >
> > here is a tarball. Hope it helps.
> >
>
> Is there any advantage of LU over Cholesky decomposition?
>
> --
> Brian Gough
>
> Network Theory Ltd
> 15 Royal Park
> Bristol BS8 3AL
> United Kingdom
>
> Tel: +44 (0)117 3179309
> Fax: +44 (0)117 9048108
> Web: http://www.network-theory.co.uk/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multivariate gaussian distribution (Code) / bugfix
2003-12-29 11:41 ` Brian Gough
2003-12-29 16:47 ` Emmanuel Benazera
@ 2004-04-28 8:08 ` Emmanuel Benazera
1 sibling, 0 replies; 6+ messages in thread
From: Emmanuel Benazera @ 2004-04-28 8:08 UTC (permalink / raw)
To: Brian Gough; +Cc: gsl-discuss
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
Hi Brian,
There was an ugly bug in files I sent to this list a few months
ago. Someone kindly pointed it to me. So here is an updated version.
I've added a function that uses the Cholesky decomposition. On a simple
example, results appear deceiving compared to the LU decomposition.
Someone here would like to investigate further (code + results) before
using this function.
Btw, alpha doesn't appear in functions for triangular matrix that are
described p.117 of gsl-ref.
cheers,
Emmanuel
On Mon, Dec 29, 2003 at 11:41:10AM +0000, Brian Gough wrote:
> Emmanuel Benazera writes:
> > Hi,
> >
> > here is a tarball. Hope it helps.
> >
>
> Is there any advantage of LU over Cholesky decomposition?
>
> --
> Brian Gough
>
[-- Attachment #2: gsl_mvg.tar.gz --]
[-- Type: application/x-tar-gz, Size: 60578 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-04-28 8:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-20 11:10 multivariate gaussian distribution Emmanuel Benazera
2003-12-22 14:21 ` Brian Gough
2003-12-28 10:29 ` multivariate gaussian distribution (Code) Emmanuel Benazera
2003-12-29 11:41 ` Brian Gough
2003-12-29 16:47 ` Emmanuel Benazera
2004-04-28 8:08 ` multivariate gaussian distribution (Code) / bugfix Emmanuel Benazera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).