predict.TARMA {tseriesTARMA} | R Documentation |
Forecast from fitted TARMA models.
Description
Forecasting with TARMA models
Usage
## S3 method for class 'TARMA'
predict(
object,
x,
n.ahead = 0,
n.sim = 1000,
quant = c(0.05, 0.95),
pred.matrix = FALSE,
...
)
Arguments
object |
A |
x |
The fitted time series. |
n.ahead |
The number of steps ahead for which prediction is required. |
n.sim |
The number of Monte Carlo replications used to simulate the prediction density. |
quant |
Vector of quantiles (in the interval |
pred.matrix |
Logical. if |
... |
Additional arguments. |
Details
If n.ahead = 0
it gives the fitted values from the model.
If the fit is from TARMA.fit2
and includes covariates, these are ignored.
Value
A list with components pred.matrix
, pred
, and pred.interval
. The latter two are ts
objects that contain the prediction and the quantiles of the prediction density, respectively.
If pred.matrix = TRUE
then the prediction density from which the quantiles are computed is also returned.
Author(s)
Simone Giannerini, simone.giannerini@unibo.it
Greta Goracci, greta.goracci@unibo.it
References
-
Giannerini S, Goracci G (2021). “Estimating and Forecasting with TARMA models.” University of Bologna.
See Also
TARMA.fit
and TARMA.fit2
for TARMA modelling. plot.tsfit
for plotting TARMA fits and forecasts.
Examples
## a TARMA(1,1,1,1) model
set.seed(13)
x1 <- TARMA.sim(n=200, phi1=c(0.5,-0.5), phi2=c(0.0,0.5), theta1=-0.5, theta2=0.7, d=1, thd=0.2)
fit1 <- TARMA.fit(x1, method='L-BFGS-B',tar1.lags = 1, tar2.lags = 1, tma1.lags = 1,
tma2.lags = 1, d=1, threshold=0.2)
xp1 <- predict(fit1,x1,n.ahead=2)
xp1