View source: R/predict.TARMA.R
predict.TARMA | R Documentation |
Forecasting with TARMA models
## S3 method for class 'TARMA'
predict(
object,
x,
n.ahead = 0,
n.sim = 1000,
quant = c(0.05, 0.95),
pred.matrix = FALSE,
...
)
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. |
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.
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.
Simone Giannerini, simone.giannerini@uniud.it
Greta Goracci, greta.goracci@unibz.it
Gia21tseriesTARMA
TARMA.fit
and TARMA.fit2
for TARMA modelling. plot.tsfit
for plotting TARMA fits and forecasts.
## 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.