[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [Help-gsl] Question to random number generation

**From**: |
Alexander Dietz |

**Subject**: |
Re: [Help-gsl] Question to random number generation |

**Date**: |
Thu, 17 May 2007 19:28:36 +0100 |

Hi,
On 5/17/07, Martin Jansche <address@hidden> wrote:

On 5/17/07, Alexander Dietz <address@hidden> wrote:
> I would like to draw
> numbers from a multivariate Gaussian distribution, given a covariance
> matrix. Is there such a function that can do this?
There is no such function in GSL, but all the ingredients are there. See
http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Drawing_values_from_the_distribution
for the general idea, and gsl_linalg_cholesky_decomp() for the
Cholesky decomposition.

Thanks for this link, I already took a look at this description. I just
wonder how to code it up properly with gsl. I know that in some cases the
matrix you put in to a function gets overwritten(?), so I wonder if someone
has a piece of code that does exactly what is described in the wikipedia
link.
Also, when I use the gsl call for the decomposition
(gsl_linalg_cholesky_decomp()) is only the upper left of the actual
decomposition returned or the full matrix? It seems to me that only a half
is returned and I have to fill 'by hand' the other half of the matrix.
I would be grateful for any more help...
Cheers
Alex
-- mj