CONTENTS

Exercise: Cholesky Factorisation and Simulating Correlated Gaussians

Prerequisites: Covariance Matrices

Problem

You want to simulate a 33-dimensional gaussian vector with mean μ=(0.05,0.08,0.10)\mu = (0.05, 0.08, 0.10) (annual returns) and covariance matrix

Σ=(0.040.020.010.020.090.030.010.030.16).\Sigma = \begin{pmatrix}0.04 & 0.02 & 0.01 \\ 0.02 & 0.09 & 0.03 \\ 0.01 & 0.03 & 0.16\end{pmatrix}.

(Three assets with volatilities 20%,30%,40%20\%, 30\%, 40\% and moderate correlations.)

  1. Compute the Cholesky factor LL (lower triangular with LL=ΣLL^\top = \Sigma) by hand (or using np.linalg.cholesky). Verify LL=ΣLL^\top = \Sigma.
  2. Explain why, if ZN(0,I3)Z \sim \mathcal{N}(0, I_3) and X=μ+LZX = \mu + LZ, then XN(μ,Σ)X \sim \mathcal{N}(\mu, \Sigma).

  3. Simulate N=10,000N = 10{,}000 such vectors. Compute the empirical mean and covariance and verify they are close to μ\mu and Σ\Sigma.

  4. Portfolio variance check. For an equal-weighted portfolio w=(1/3,1/3,1/3)w = (1/3, 1/3, 1/3), compute (a) theoretical portfolio variance wΣww^\top\Sigma w and (b) empirical variance of wXiw^\top X_i across your NN samples. They should agree within sampling noise.

Hint

np.random.default_rng(0).standard_normal((N, 3)) gives i.i.d. standard-normal samples. Multiply by LL^\top on the right (note transpose convention) or by LL on the left column-wise.
Jump to the solution when you're ready.