predict.Arima | R Documentation |
Forecast from models fitted by arima
.
## S3 method for class 'Arima' predict(object, n.ahead = 1, newxreg = NULL, se.fit = TRUE, ...)
object |
The result of an |
n.ahead |
The number of steps ahead for which prediction is required. |
newxreg |
New values of |
se.fit |
Logical: should standard errors of prediction be returned? |
... |
arguments passed to or from other methods. |
Finite-history prediction is used, via KalmanForecast
.
This is only statistically efficient if the MA part of the fit is
invertible, so predict.Arima
will give a warning for
non-invertible MA models.
The standard errors of prediction exclude the uncertainty in the estimation of the ARMA model and the regression coefficients. According to Harvey (1993, pp. 58–9) the effect is small.
A time series of predictions, or if se.fit = TRUE
, a list
with components pred
, the predictions, and se
,
the estimated standard errors. Both components are time series.
Durbin, J. and Koopman, S. J. (2001). Time Series Analysis by State Space Methods. Oxford University Press.
Harvey, A. C. and McKenzie, C. R. (1982). Algorithm AS 182: An algorithm for finite sample prediction from ARIMA processes. Applied Statistics, 31, 180–187. \Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("10.2307/2347987")}.
Harvey, A. C. (1993). Time Series Models, 2nd Edition. Harvester Wheatsheaf. Sections 3.3 and 4.4.
arima
od <- options(digits = 5) # avoid too much spurious accuracy predict(arima(lh, order = c(3,0,0)), n.ahead = 12) (fit <- arima(USAccDeaths, order = c(0,1,1), seasonal = list(order = c(0,1,1)))) predict(fit, n.ahead = 6) options(od)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.