Displaying 1 result from an estimated 1 matches for "drevtotal".
Did you mean:
revtotal
2002 Nov 18
1
Prediction from arima() object (library ts) (PR#2305)
...r(i in 1:length(total))
revtotal[i] <- total[length(total)-i+1]
# first model
m1 <- arima(revtotal, c(1,1,1))
pm1 <- predict(m1, n.ahead=15)
plot(1:47, y=revtotal, type="l", xlim=c(0,65))
lines(48:62, y=pm1$pred, col="red")
# second model - differencing done manually
drevtotal <- diff(revtotal)
m <- arima(drevtotal, c(1,0,1))
pm <- predict(m, n.ahead=15)
p <- numeric(15)
p[1] <- pm$pred[1] + revtotal[length(revtotal)]
for(i in 2:15)
p[i] <- p[i-1] + pm$pred[i]
plot(1:47, y=revtotal, type="l", xlim=c(0,65))
lines(48:62, y=p, col="red"...