I need to generate random noise for 3 variables, i.e. X
, Y
and Z
. I need X
to be lognormal, and Y
and Z
is normal. The correlation matrix should be:
1, -0.8, 0.5
-, 1, -0.5
0.5,-0.5, 1
The std of X
and Y
and Z
should be 0.5, 0.3 and 20. The mean of X
and Y
should be 1, and 0 for Z
. How can I do that?
I know I can use Generate correlated data in Python (3.3) to generate 3 normally distributed. So how can I apply it to my case?
I think I can firstly generate X1=log(X)
, Y
and Z
at first. But how can I set the correlation matrix? i.e. if the corr(X, Y)=-0.8
, what is corr(log(X), Y)
?
-----advanced version
what if I want X
and Y
and Z
all be AR(1) process?
Thanks!