# Generate correlated AR process for given correlation between demand series

How can I generate two correlated $AR(1)$ data series with given correlation between $d_{1,t}$ and $d_{2,t}$, $r_{12}$, where $\rho_{12}$ is correlation between the two error series $$d_{1,t}=\mu+\phi_1d_{1,(t−1)}+e_{1}(t)\quad\quad d_{2,t}=\mu+\phi_2d_{2,(t-1)}+e_{2}(t)$$

$e_1$ and $e_2$ are not the same and $r_{12}$ is desired correlation between $d_{1,t}$ and $d_{2,t}$. The relations between $r_{12}$ and $\rho_{12}$ is:

$$r_{12}=\rho_{12}*\sqrt{(1-\phi_1^2)*(1-\phi_2^2)}/ (1-\phi_1\phi_2)$$

one example for: $\phi_1=.3$, $\phi_2=-.8$ AND $r_{12}=-.8$; the problem is, for this example $\rho_{12}$ is $-1.7$, now how can I generate the error terms where the correlation between the two error series $\rho_{12}$ is not between $-1$ and $+1$. please help me if i'm wrong somewhere. THANKS YOU

-

You need to generate random numbers from $e_{1}$ and $e_{2}$ jointly, such as by a multivariate normal distribution (using the covariance between the error terms). Then using those values and the other known variables you can simply plug them in to $d_{1}$ and $d_{2}$. – John Nov 1 '12 at 20:06
Thanks for your answer, the PROBLEM is: I'd like to generate two correlated series with r12=-.8 or -.9 but for these values ρ12=-1.7 while ρ12 must be -1<ρ12<+1 – Roji Nov 1 '12 at 21:54
to generate e1 and e2 jointly I need ρ12, how can i calculate ρ12 ? – Roji Nov 1 '12 at 21:55
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 24, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.936682939529419, "perplexity_flag": "head"}