# "arima.sim" is a function in "stats".
# Note that the sign of MA coefficient is opposite from that in "timsac".
y <- arima.sim(list(order=c(2,0,1), ar=c(0.64,-0.8), ma=c(-0.5)), n=350)
y1 <- y[51:300]
z <- autoarmafit(y1)
ar <- z$model[[1]]$arcoef
ma <- z$model[[1]]$macoef
var <- z$model[[1]]$v
y2 <- y[301:350]
prdctr(y2, r=30, s=50, h=10, arcoef=ar, macoef=ma, v=var)
Run the code above in your browser using DataLab