Skip to content
All library documents

Simulating Correlated Normal Returns with a Covariance Matrix

Article Quant Q&A · Author: alexandra

Summary

The document explains how to generate multivariate Gaussian returns with a target covariance structure. Starting with a vector of independent standard normal draws, apply a matrix square root of the desired covariance matrix. A Cholesky factor is one such square root; multiplying the independent draws by it produces simulated variables with the intended covariance.

The answer recommends using the covariance matrix when the simulation must match specified variances as well as correlations. Correlation can then be derived by scaling covariances by the relevant standard deviations. The essential requirement is that the covariance matrix be positive semidefinite and suitable for the chosen factorization. The example is a basic Gaussian construction; it does not address non-normal returns, time-varying dependence, or other features needed for a more realistic market model.

Key ideas

  • Generate independent standard normal variables as the input to a multivariate Gaussian simulation.
  • Multiply those draws by a matrix square root of the target covariance matrix.
  • A Cholesky factor provides a suitable square root when the covariance matrix supports the factorization.
  • The covariance matrix captures both marginal variances and cross-variable dependence.
  • Derive correlations by scaling covariances with the variables’ standard deviations.

Tags

Full text
# Monte Carlo - Multivariate Simulation of Returns


# Monte Carlo - Multivariate Simulation of Returns












I am implementing a Monte Carlo simulation in R to generate multivariate correlated returns. In doing this I have used the Cholesky decomposition, applied to the covariance matrix. However, I saw that the Cholesky decomposition could be applied also to the correlation matrix. Which is the appropriate approach?

## Answer by phdstudent (score 5, accepted)

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

You should apply it to the covariance matrix and from that compute the correlation matrix. Here's an example correlating 3 random normal variables.

Let:

$$ \bf Y \sim \mathcal N(0, \Sigma) $$

where $\textbf{Y} = (Y_1,\dots,Y_n)$ is the vector of normal random variables, and $\Sigma$ the given covariance matrix.

The process is:

- Simulate a vector of uncorrelated Gaussian random variables, $\bf Z $

- Then find a square root of $\Sigma$, i.e. a matrix $\bf C$ such that $\bf C \bf C^\intercal = \Sigma$.

Then the target vector is given by $$ \bf Y = \bf C \bf Z. $$

Here is a dummy matlab code:

```
N = 500000
u_1 = normrnd(zeros(N,1),1);
u_2 = normrnd(zeros(N,1),1);
u_3 = normrnd(zeros(N,1),1);
u_4 = normrnd(zeros(N,1),1);

rv = [u_1 '; u_2'; u_3'; u_4'];

VarCov = [Some positive semi-definite matrix here 4x4];

ch = chol(VarCov);
result = ch * rv;
```

Then just divide each entry of the result matrix by the product of the standard deviations to get a correlation matrix.

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.