This project has moved and is read-only. For the latest updates, please go here.

Multivariable Random Number Generator

Aug 16, 2013 at 9:25 PM

I've been developing a massive multivariable parallel random number generator. The idea is to feed it with a correlation matrix and use it as a seed to create random correlated numbers. The math behind is quite simple: I take the correlation matrix [n x n], decompose it through cholesky and finally multiply by a random matrix [1 x n].

I was giving a look at the MathNet.Numerics.Distributions and realized that there is a huge amount of distribution generators, but I couldn't find one that suits my needs.

So my question is: does anyone knows if there is a helper for that in MathNet?

Best Regards,
Aug 16, 2013 at 9:55 PM
Hi Rafael,

It seems to me MatrixNormal (wikipedia) is not exactly but quite close to what you describe. It is parametrized by a mean matrix and two covariance matrices for rows and columns. Sampling is close to what you describe, although the random matrix factor is fixed to be normally distributed.

Aug 19, 2013 at 2:35 PM
Edited Aug 19, 2013 at 2:35 PM
Thanks Christoph!

I was giving a look at the documentation, but I didn't fully understand how to use it. There you say:

The distribution is parameterized by a mean matrix (M), a covariance matrix for the rows (V) and a covariance matrix for the columns (K). If the dimension of M is d-by-m then V is d-by-d and K is m-by-m.

But now I have a question. Let's say that I have the following correlation matrix for 3 different variables:
       v1  v2  v3
v1  [ 1, 0.6, 0.3 ]
v2  [ 0.6, 1, 0.5 ]
v3  [ 0.3, 0.5, 1 ]
You are saying that in order to use the Matrix Distribution, should I have a 3 x 3 M, a 3 x 3 K and a 3 x 3 V. The M is fine for me, but I just don't understand how to work with V and K, as I was expecting a 1 x 3 and 3 x 1 matrices for row and column covariances...