prdctr {timsac} | R Documentation |
Operate on a real record of a vector process and compute predicted values.
prdctr(y, r, s, h, arcoef, macoef = NULL, impulse = NULL, v, plot = TRUE)
y |
a univariate time series or a multivariate time series. |
r |
one step ahead prediction starting position R. |
s |
long range forecast starting position S. |
h |
maximum span of long range forecast H. |
arcoef |
AR coefficient matrices. |
macoef |
MA coefficient matrices. |
impulse |
impulse response matrices. |
v |
innovation variance. |
plot |
logical. If |
One step ahead Prediction starts at time R and ends at time S. Prediction is continued without new observations until time S+H. Basic model is the autoregressive moving average model of y(t) which is given by
y(t) - A(t)y(t-1) -...- A(p)y(t-p) = u(t) - B(1)u(t-1) -...- B(q)u(t-q),
where p is AR order and q is MA order.
predct |
predicted values : |
ys |
|
pstd |
|
p2std |
|
p3std |
|
mstd |
|
m2std |
|
m3std |
|
H.Akaike, E.Arahata and T.Ozaki (1975) Computer Science Monograph, No.6, Timsac74, A Time Series Analysis and Control Program Package (2). The Institute of Statistical Mathematics.
# "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 = 1000) y1 <- y[1:900] z <- autoarmafit(y1) ar <- z$model[[1]]$arcoef ma <- z$model[[1]]$macoef var <- z$model[[1]]$v y2 <- y[901:990] prdctr(y2, r = 50, s = 90, h = 10, arcoef = ar, macoef = ma, v = var)