Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I can generate normal random numbers in $N(0,1)$, how can I generate two dependent random numbers, $Y_1$ and $Y_2$ with means $\mu_1$, $\mu_2$ and $\sigma_1$, $\sigma_2$ and correlation coefficient $\rho$ respectively? Is there a known method for this problem?

share|cite|improve this question
up vote 8 down vote accepted

If $X_1$ and $X_2$ are i.i.d. standard gaussian, then $X_3=\rho X_1+\sqrt{1-\rho^2}X_2$ is standard gaussian as well and the correlation of $X_1$ and $X_3$ is $\rho$. Hence, starting from $X_1$ and $X_2$, one can use $$ Y_1=\mu_1+\sigma_1X_1,\quad Y_2=\mu_2+\sigma_2\left(\rho X_1+\sqrt{1-\rho^2}X_2\right). $$

share|cite|improve this answer
Thanks! Just a quick question, how can we prove that the correlation of $X_1$ and $X_3$ is $\rho$ then? – LBJ Feb 29 '12 at 21:11
Since $X_1$ and $X_3$ are centered and have unit variance, their correlation is $E(X_1X_3)$, which one computes by expanding the product. – Did Feb 29 '12 at 21:21
Got it again...I'm so stupid... – LBJ Feb 29 '12 at 21:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.