predict.tenAR | R Documentation |
S3 method for the 'tenAR' class using the generic predict function. Prediction based on the tensor autoregressive model or reduced rank MAR(1) model. If rolling = TRUE
, returns the rolling forecasts.
## S3 method for class 'tenAR'
predict(object, n.ahead = 1, xx = NULL, rolling = FALSE, n0 = NULL, ...)
object |
a model object returned by |
n.ahead |
prediction horizon. |
xx |
|
rolling |
TRUE or FALSE, rolling forecast, is FALSE by default. |
n0 |
only if |
... |
Additional arguments passed to the method. |
a tensor time series of length n.ahead
if rolling = FALSE
;
a tensor time series of length T^{\prime} - n_0 - n.ahead + 1
if rolling = TRUE
.
'predict.ar' or 'predict.arima'
set.seed(333)
dim <- c(2,2,2)
t = 20
xx <- tenAR.sim(t, dim, R=2, P=1, rho=0.5, cov='iid')
est <- tenAR.est(xx, R=1, P=1, method="LSE")
pred <- predict(est, n.ahead = 1)
# rolling forcast
n0 = t - min(50,t/2)
pred.rolling <- predict(est, n.ahead = 5, xx = xx, rolling=TRUE, n0)
# prediction for reduced rank MAR(1) model
dim <- c(2,2)
t = 20
xx <- tenAR.sim(t, dim, R=1, P=1, rho=0.5, cov='iid')
est <- matAR.RR.est(xx, method="RRLSE", k1=1, k2=1)
pred <- predict(est, n.ahead = 1)
# rolling forcast
n0 = t - min(50,t/2)
pred.rolling <- predict(est, n.ahead = 5, rolling=TRUE, n0=n0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.