I have a random column vector $\vec{X}$ of three independent random variables $X_1, X_2, X_3$ with normal distribution (and known mean and variance). I need to write $\vec{X}$ in the form $\vec{X} = \mu +B\vec{Z}$.
How do I find $B$? I'm guessing it has something to do with the variance.
Let $X_i \sim \mathcal{N}(\mu_i, \sigma_i)$ for $i=1,2,3$. You can generate these random variables from three i.i.d. standard normal random variables. So, letting $Z_i \sim \mathcal{N}(0,1)$ for $i=1,2,3$ i.i.d., you have \begin{align*} \begin{bmatrix}X_1 \\ X_2 \\ X_3 \end{bmatrix} = \begin{bmatrix}\mu_1 \\ \mu_2 \\ \mu_3 \end{bmatrix} + \begin{bmatrix}\sigma_1 & 0 & 0 \\ 0 & \sigma_2 & 0 \\ 0 & 0 & \sigma_3 \end{bmatrix} \begin{bmatrix}Z_1 \\ Z_2 \\ Z_3 \end{bmatrix} \end{align*}
You can read more about it here. The high-level intuition is that the $\sigma$ factors stretch the distribution and adapt the variance and the $\mu$ offset shifts it and centers it at the desired mean.