Generate two correlated ARMA(1,1) processes How can I generate two correlated ARMA(1,1) data series where
$d_{1,t}=\mu+\phi_{1}d_{1,(t-1)}-\theta_1(e_1(t-1)+e_1(t))$
$d_{2,t}=\mu+\phi_{2}d_{2,(t-1)}-\theta_2(e_2(t-1)+e_2(t))$
and $\rho_{12}$ is desired correlation between $e_1$ and $e_2$?
 A: The following R code will do what you want. I have used $\rho_{12}=0.5$, $\mu=10$, $\phi_1=0.2$, $\phi_2=0.8$, $\theta_1=0.3$, $\theta_2=-0.7$ and I have assumed that the errors have mean zero and variance 1.
library(mvtnorm)
rho <- 0.5
mu <- c(10,10)
phi <- c(0.2,0.8)
theta <- c(0.3,-0.7)
d <- ts(matrix(0,ncol=2,nrow=50))
e <- ts(rmvnorm(50,sigma=cbind(c(1,rho),c(rho,1))))
for(i in 2:50)
  d[i,] <- mu + phi*d[i-1,] - theta*(e[i-1,]+e[i,])
plot(d)

A: I will assume that the e1 and e2 terms are iid noise terms with 0 mean and constant variance.  If that is the right way to interpret the model you can compute the correlation between d$_1$ and d$_2$ as a function of the correlations between e$_1$ and e$_2$. Since you now have clarified that ρ$_1$$_2$ is the correlation between e$_1$ and e$_2$ it is simpler than what I said originally.  Again you haven't said whether you want to specify the entire cross correlation or just the zero lag crosscorrelation.  One way to do this is to generate a bivariate normal distribution with mean vector (0,0)$^T$ and specified covariance martix having diagonal elements 1 and off diagonal elements ρ$_1$$_2$.  There should be routines to do this. If you can't find one generate two independent normals a$_1$ and a$_2$ and let e$_1$=a$_1$ and e$_2$ =  ρ$_1$$_2$ a$_1$ + a$_2$ where a$_2$ is chosen to have the variance that makes the variance of e$_2$ = 1 and a$_1$ has variance 1.
