# Generate correlated random variables from Normal and Gamma distributions

I want to generate a random vector $z$ of dimension $k+m$ with some given correlation matrix $\Sigma$, such that the first $k$ elements of the vector are distributed normally and the last $m$ elements follow the Gamma distribution with some given parameters $a,b$.

Hier is suggested (applied to this case) to generate a normal r.v. Z as $N(0,\Sigma)$ and then solve $G_{[a,b]}(Y_i)=\Phi_{[0,\Sigma]}(Z_i), i\geq m$ and replace the last m elements of Z with Ys, however it's not guaranteed that the vector $(Z_1, ... , Z_k, Y_{k+1}, ..., Y_{k+m})$ will still have the correlation matrix $\Sigma$.

Is there some nice copula out there that does the job or some other approach?

-

Look here for multivariate distribution on the positive quadrant ... quite difficult. http://xianblog.wordpress.com/tag/multivariate-analysis/ I have been thinking about this for weeks and months in the context of credit risk (modelling default intensities jointly) and I think this does not work.

-
Assume that this mixture of distribution is given and I can't escape into log-normal and to some extent tolerant towards negative values. Simulating into positive quadrant with given covariance is also interesting, thanks for this! –  Max Li Jan 13 '13 at 20:22
In Oracle Crystal Ball (or in a few other Excel based MC simulation add-ins), we can do this without much hassle: define $k$ normal distribution and $m$ gamma distributions. Define (or load) the correlation matrix $\Sigma$ and then generate the random variates. Each trial run would give you one random vector $z$ of dimension $k+m$.