Getting specified correlation matrix from i.i.d. zero mean Gaussian random variables Say there are two zero mean, unit variance Gaussian random variables, $X_1$ and $X_2$. The covariance matrix of the vector $\bf{X} = [X_1, X_2]^T$ is then
\begin{align*}
C_X = 
\begin{bmatrix}
1 & 0\\
0 & 1
\end{bmatrix}.
\end{align*}
Now I would like to get a new vector $\bf{Y}$ from $\bf{X}$ using linear transformations, such that the covariance matrix of $\bf{Y}$ is
$$
C_Y = 
\begin{bmatrix}
1 & \rho \\
\rho & 1
\end{bmatrix}.
$$
I tried the following linear transformation
$$
\bf{Y} = \begin{bmatrix}
1 & \rho \\
\rho & 1
\end{bmatrix} \bf{X}.
$$
This gives me the covariance matrix
$$
C_Y = 
\begin{bmatrix}
1+\rho^2 & 2\rho \\
2\rho & 1+\rho^2
\end{bmatrix}.
$$
I can reduce the variance of $X_1$ and $X_2$ to $\frac{1}{2}$ so that I can have $\rho$ in the off diagonal entries. Under this adjustment $Y_1$ and $Y_2$ would each have variance $\frac{1+\rho^2}{2}$, which I can normalize to get $1$ in the diagonal entries.
So now I have two questions

*

*Is this the best way to get the required covariance matrix?

*If the dimensionality of $\bf{X}$ is $n$, I would need to divide $\bf{X}$ by $\sqrt{n}$. Is that right? How would I normalize the diagonal entries of $\bf{Y}$ to be $1$? In this case I would require the covariance matrix to have $\rho$ in all the off-diagonal entries and $1$ along diagonal entries.

Any help is appreciated.

Choose $Y = C_Y^{\frac{1}{2}}X$,
$$ \begin{align*}
 \mathbb{E}[YY^T] &= \mathbb{E}[C_Y^\frac{1}{2} X X^T C_Y^\frac{1}{2}] \\
 &= C_Y^\frac{1}{2} \mathbb{E}[X X^T] C_Y^\frac{1}{2} \\
&= C_Y^\frac{1}{2} C_X C_Y^\frac{1}{2} \\
&= C_Y 
\end{align*}$$
