Exercise: Cholesky Factorisation and Simulating Correlated Gaussians
Prerequisites: Covariance Matrices
Problem
You want to simulate a -dimensional gaussian vector with mean (annual returns) and covariance matrix
(Three assets with volatilities and moderate correlations.)
-
Compute the Cholesky factor (lower triangular with ) by hand (or using
np.linalg.cholesky). Verify . -
Explain why, if and , then .
-
Simulate such vectors. Compute the empirical mean and covariance and verify they are close to and .
-
Portfolio variance check. For an equal-weighted portfolio , compute (a) theoretical portfolio variance and (b) empirical variance of across your 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 on the right (note transpose convention) or by on the left column-wise.Jump to the solution when you're ready.