Skip to content
All library documents

Generating Correlated Normal Variables with a Covariance Matrix

Article Quant Q&A · Author: vsa

Summary

This explanation shows how to create correlated standard normal variables from independent standard normals. For two variables, one can use the first independent draw directly and form the second as a weighted combination of that draw and another independent draw. The weights preserve unit variance and produce the desired correlation; the response verifies this by calculating covariance and then correlation.

For a larger set of variables, the target relationships are collected in a covariance matrix. If the matrix is factored as a matrix times its transpose, multiplying a vector of independent standard normals by the factor yields variables with the target covariance. Cholesky decomposition is presented as a convenient way to obtain such a factor, not the only way: any factor satisfying the same matrix identity works. The explanation assumes a valid covariance matrix and does not discuss numerical issues or alternatives for matrices that cannot be factored as required. This construction is useful when simulating jointly distributed risk factors or Brownian increments.

Key ideas

  • Two correlated standard normal variables can be formed from independent standard normals using a correlation-based linear combination.
  • The covariance calculation shows that the constructed pair has the target correlation.
  • For multiple variables, multiply independent standard normals by a factor of the desired covariance matrix.
  • Cholesky decomposition is a convenient factorization, but other factors satisfying the same identity can also be used.
  • The method requires a covariance matrix that admits the needed factorization.

Tags

Full text
# Correlation between brownian motions and Cholesky decomposition


# Correlation between brownian motions and Cholesky decomposition












I know it is a pretty basic question (I'm new at Quantitative Finance), but what's the logic behind the Brownian Motions correlation?

The expression is:

Where is this formula coming from?

On the other hand, when there are more than two motions, the process is to apply Cholesky decomposition to the covariance matrix. Why is this necessary?

Many thanks!

## Answer by Gábor Pálovics (score 6, accepted)

https://quant.stackexchange.com/a/64069

I assume, the first equation is about creating 2 correlated standard normal random variables. Then $X_1 = Z_1$ and $X_2 = \rho Z_1 + \sqrt{1- \rho^2}Z_2 $ are correlated with correlation $\rho$. One can prove this by calculateing the covariance. $$\text{Cov}(X_1, X_2) = \mathbb{E}(X_1X_2) - \mathbb{E}(X_1) \mathbb{E}(X_2) = \rho \mathbb{E}(Z_1^2) + 0 = \rho$$ $$\text{Corr}(X_1, X_2) = \frac{\rho}{\sigma_{X_1}\sigma_{X_2}} = \rho$$

The case is a little more complicated if you want more $X_i$ to correlate. Then you will end up with a covariance/correlation matrix. Let's consider the covariance matrix ($\Sigma$). We want the following property to hold: $$\text{Cov}(X, X) = \Sigma$$ Then if you have $\{U_i\}$ i.i.d. standard normal variables, and the Cholesky factorization of your covariance matrix ($\Sigma = J J^T$), you can create the wanted correlated X variables as follows: $$X = JU \text{ , then }$$ $$\text{Cov}(X, X) = \mathbb{E}(X X^T) - \mathbb{E}(X) \mathbb{E}(X^T) = \mathbb{E}(JUU^TJ^T) - 0 = J \mathbb{E}(UU^T)J^T = J I J^T = \Sigma$$

You can use this approach for the 2 variable case as well, in this case the covariance matrix looks like this $\begin{bmatrix} 1 & \rho \\ \rho & 1 \end{bmatrix}$. But since the only variable in this matrix is $\rho$, we like to simplify this case. For more variables it's not doable as the number of free parameters is $n (n-1)/2$, which grows quadratically, so there you have to work with the matrix solution.

Note: It's not necessary to use the Cholesky-decomposition. You can use any $A$ matrix which satisfies $\Sigma = A A^T$, but it's the easiest choice most of the time.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.