TITLE: Generate Correlated Normal Random Variables
QUESTION [46 upvotes]: I know that for the $2$-dimensional case: given a correlation $\rho$ you can generate the first and second values, $ X_1 $ and $X_2$, from the standard normal distribution. Then from there make $X_3$ a linear combination of the two $X_3 = \rho X_1 + \sqrt{1-\rho^2}\,X_2$ then take 
$$ Y_1 = \mu_1  + \sigma_1 X_1, \quad Y_2 = \mu_2 + \sigma_2 X_3$$
So that now $Y_1$ and $Y_2$ have correlation $\rho$.
How would this be scaled to $n$ variables? With the condition that the end variables satisfy a given correlation matrix? I'm guessing at least n variables will need to be generated then a reassignment through a linear combination of them all will be required... but I'm not sure how to approach it.

REPLY [3 votes]: $\newcommand{\Cov}{\mathrm{Cov}}$
I wanted to add that comment to the previous answer :
Why is it true ?
Define $Y = \mu + C Z$, and recall that each component of $Z$ is i.i.d. normal :
$$ \Cov( Y ) = \Cov(CZ + \mu ) = \Cov(CZ ) = C \cdot \Cov (Z) \cdot C^T = C I C^T = \Sigma $$
which is the desired result :
$$ \implies Y \sim \mathcal N (\mu, \Sigma) $$