Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. 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

I generate the IMA(1,1) process in R to see ACF for different values of Theta. The graphs show that ACF is always positive for both positive and negative values of Theta, is it correct or I'm wrong somewhere?

theta <- 0.9
d <- ts(matrix(0,ncol=1,nrow=100))
e <- ts(rnorm(100,0,1))
d[1] <- e[1]
for(i in 2:100)
  d[i] <- d[i-1]-theta*(e[i-1]+e[i])

Theta=0.9 enter image description here Theta=-0.9 enter image description here

share|improve this question
That's correct; it's the "I" in "IMA" that makes it so. – jbowman Dec 15 '12 at 17:21

PS: After the comment I'm feeling in doubt of what I've done. Please correct me if I'm wrong.

UPD: I think this part d[i] <- d[i-1] - theta*(e[i-1] + e[i]) should be this d[i] <- d[i-1] - theta*e[i-1] + e[i] cause in ARMA only previous random parts: $\varepsilon_{i}$ - is multiplied by $\theta$'s.

UPD: With the help of jbowman I've checked the idea of positive ACF with more correct modeling.

R does have the functions to model the general ARIMA process and much more:

imap.sim <- arima.sim(model=list(order=c(0,1,1), ma=0.9), n=100) # modeling with positive theta
iman.sim <- arima.sim(model=list(order=c(0,1,1), ma=0.9), n=100) # modeling with negative theta
ts.plot(imap.sim) # plotting
imap.acf <- acf(imap.sim, type="correlation", plot=T)
iman.acf <- acf(iman.sim, type="correlation", plot=T)

And the results:

  • With positive theta: enter image description here
  • With negative theta: enter image description here
share|improve this answer
I believe the correct syntax for the arima simulation is iman.sim <- arima.sim(model=list(order=c(0,1,1), ma=-0.9), n=100). I think the d=1 is ignored, and you're actually generating an MA(1) process; the first order autocorrelation of roughly (+/-) 0.5 would support this hypothesis. I agree, however, that arima.sim is the way to go. – jbowman Dec 15 '12 at 18:42

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.