LessonThis is a lesson restated in new words. Any figure in it is an example from the source, not this desk's record.
Independent normal shocks make two paths that ignore each other. Portfolio risk and basket options need the opposite: shocks that move together by a correlation you choose. A matrix factor and a two-line formula impose the same correlation, and on one shared set of draws they produced the same paths.
Why it matters
From January through August 2016, the lecture plotted the S&P 500 against the VIX and described the pair as moving in opposite directions often enough to call the link relatively negative. Many other pairs behave that way. If a risk report or a path-dependent price pretends the driving noise is independent, the joint moves are wrong even when each asset’s own volatility is right. Correlation has to be imposed on the simulated shocks, not hoped for after the fact.
A Brownian motion here is the continuous random walk used as the noise inside a price model. Its increments are normal, centered at zero, with variance equal to the time step. “Correlated Brownian motions” means two of those walks whose increments share a chosen correlation.
The idea in plain words
Both methods start from the same target. For two assets, put 1 on the diagonal of a 2 by 2 matrix and put the correlation in the off-diagonal cells. The example used negative 0.9, a strong opposite link in the spirit of the index-and-volatility picture. A correlation matrix of this kind is symmetric and positive definite, which is the condition a standard factor routine expects.
The first method asks NumPy for the Cholesky factor: a lower-triangular matrix L such that L times its transpose returns the correlation matrix. Draw a 2 by 1,000 matrix of normal increments with mean 0 and standard deviation equal to the square root of the time step. The lecture used a step of 1/252, one trading day. Multiply L by that matrix. The rows are now correlated increments. A cumulative sum turns increments into levels that start at zero.
The second method never forms L. Take two independent Brownian motions, call them W and Z. Build a third process as correlation times W, plus the square root of 1 minus correlation squared, times Z. That combination is another Brownian motion, and its correlation with W is the number you inserted. Using the same two raw paths as before, the formula reproduced the Cholesky paths exactly. Nothing was redrawn.
A sample correlation is not the target. On these 1,000 steps the off-diagonal coefficient came out about negative 0.886, while the diagonal stayed at 1. Both methods reported that same sample figure. The target was negative 0.9. The gap is finite-sample noise, not a disagreement between the methods.
How to use it
Pick the correlation from the problem, not from a round number you like. If the question is a two-asset book, the formula is enough and the algebra stays visible. If the book has more than two names, build the full correlation matrix, factor it once, and multiply. The matrix route scales without a new formula for every pair.
What usually goes wrong
Feeding a matrix that is not a valid correlation, for example an off-diagonal entry outside minus 1 to 1, or a matrix that is not positive definite, makes the factor routine fail or return nonsense. For two assets the bound is easy. For many assets, pairwise numbers copied from different windows often cannot live in one matrix.
Mixing a CPU array with a factor shaped the wrong way silently correlates the wrong axis. Confirm the shape: assets by time, or time by assets, and multiply on the asset axis. Checking the correlation after the cumulative sum, on a very short path, will not sit on the target. That is sampling error. The lecture’s own check was already about 0.014 away from negative 0.9 at 1,000 steps.
Questions people ask
Do the two methods need different random numbers?
No. The lecture built the formula from the same two raw paths the factor had used, and the plotted levels matched. A fresh draw would match only in distribution, not point for point.
Why was the measured correlation negative 0.886?
That was the sample coefficient of those particular increments. The matrix they factored still contained negative 0.9. A longer path would be expected to land closer, but a single path does not have to.
What does the square-root term in the formula do?
It keeps the second path’s variance equal to the time step. If you used only the correlation times the first path, the second path would be too small whenever the correlation is not 1 or minus 1.