Solved – How to simulate sets of random variables from skewed distribution with given correlation

correlationprobabilitysimulation

I’d like to simulate sets of correlated random variates $X_1, X_2, \dots, X_N$ given an $N \times N$ correlation matrix, where each of the $X$'s comes from the same positively skewed distribution. What’s a technique for doing this?

As an example, how would I simulate pairs ($X_1, X_2$) where $X$ follows a lognormal distribution and cor($X_1, X_2$) = 0.7?

Best Answer

Gaussian copula. Let $F$ be your favorite distribution function, log-normal or whatever. Let $\Psi$ be the target correlation matrix. Construct a Gaussian copula $Z(\Sigma) \in \mathbb{R}^n$ as follows.

  1. Draw $W \sim \mathcal{N}(0,I_n)$
  2. Let $X = \Sigma^{1/2}W$
  3. Let $Z(\Sigma) = [\Phi(X_1)\quad \ldots \quad \Phi(X_n)]$ where $\Phi$ is standard normal CDF.

Now, let's use your favorite distribution to obtain $$Y(\Sigma) = [F^{-1}(Z(\Sigma)_1) \ldots F^{-1}(Z(\Sigma)_n)]$$

Calculate the correlation of $Y(\Sigma)$ (you need to draw many $Y(\Sigma)$'s to do this..) Repeat the entire exercise until you find $\Sigma$ such that $Corr(Y(\Sigma))=\Psi$. When searching for appropriate $\Sigma$, use the fact that each non-diagonal element of $\Sigma$ has one-to-one monotone relation to the corresponding element of $Corr(Y(\Sigma))$.

Related Question