Generate a Sample $\underline{Z_1}$ $\underline{Z_2}\dots \underline{Z_{5000}}$ , while $\underline{Z_i} \sim N_2[(0,0)^T,I_2]$
generate new sample with size of $ n = 5000$ by applying linear transformation on $\underline{Z_i}$
$\underline{X_1}$ $\underline{X_2}\dots \underline{X_{5000}}$ , while $\underline{X_i} \sim N_2[(1,2)^T,\begin{pmatrix}2&1.5\\ 1.5&2\end{pmatrix}]$.
My attempt:
n1 <- 5000
mu <- c(0,0)
sigma <- diag(2)
y2 <- mvrnorm(n1,mu,sigma)
I have generated the first sample but aside from that , I have no idea how to continue..
Update $X = A*Z + \mu$ while $\mu = (1,2)^T.$
To find $A$ we use this equation $\Sigma = A*A^T$.
ed = eigen(Sigma)
A = ed$vectors %*% diag(sqrt(ed$values))
but still I'm not getting the right value for $A$.
because $A*A^T\neq \Sigma$.