tenAR.predict: Predictions for Tensor Autoregressive Models

Description Usage Arguments Value See Also Examples

View source: R/tenAR.R

Description

Prediction based on the tensor autoregressive model or reduced rank MAR(1) model. If rolling = TRUE, returns the rolling forecasts.

Usage

1
tenAR.predict(object, xx, n.head, rolling = FALSE, n0 = NULL)

Arguments

object

a model object returned by tenAR.est().

xx

T^{\prime} \times d_1 \times \cdots \times d_K tensor time series.

n.head

prediction horizon.

rolling

TRUE or FALSE, rolling forecast, is FALSE by default.

n0

only if rolling = TRUE, the starting point of rolling forecast.

Value

a tensor time series of length n.head if rolling = FALSE;

a tensor time series of length T^{\prime} - n_0 - n.head + 1 if rolling = TRUE.

See Also

'predict.ar' or 'predict.arima'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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 <- tenAR.predict(est, xx, n.head = 1)
# rolling forcast
n0 = t - min(50,t/2)
pred.rolling <- tenAR.predict(est, xx, n.head = 5, 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 <- tenAR.predict(est, xx, n.head = 1)
# rolling forcast
n0 = t - min(50,t/2)
pred.rolling <- tenAR.predict(est, xx, n.head = 5, rolling=TRUE, n0)

tensorTS documentation built on Aug. 10, 2021, 9:07 a.m.