\Header{predict.Arima}{Forecast from ARIMA fits}
\keyword{ts}{predict.Arima}
\begin{Description}\relax
Forecast from models fitted by \code{\Link{arima}}.\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'Arima':
predict(object, n.ahead = 1, newxreg = NULL,
        se.fit = TRUE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] The result of an \code{arima} fit.
\item[\code{n.ahead}] The number of steps ahead for which prediction is required.
\item[\code{newxreg}] New values of \code{xreg} to be used for
prediction. Must have at least \code{n.ahead} rows.
\item[\code{se.fit}] Logical: should standard errors of prediction be returned?
\item[\code{...}] arguments passed to or from other methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Finite-history prediction is used, via \code{\Link{KalmanForecast}}.
This is only statistically efficient if the MA part of the fit is
invertible, so \code{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.\end{Details}
\begin{Value}
A time series of predictions, or if \code{se.fit = TRUE}, a list
with components \code{pred}, the predictions, and \code{se},
the estimated standard errors.  Both components are time series.\end{Value}
\begin{References}\relax
Durbin, J. and Koopman, S. J. (2001) \emph{Time Series Analysis by
State Space Methods.}  Oxford University Press.

Harvey, A. C. and McKenzie, C. R. (1982) Algorithm AS182.
An algorithm for finite sample prediction from ARIMA processes.
\emph{Applied Statistics} \bold{31}, 180--187.

Harvey, A. C. (1993) \emph{Time Series Models},
2nd Edition, Harvester Wheatsheaf, sections 3.3 and 4.4.\end{References}
\begin{SeeAlso}\relax
\code{\Link{arima}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(lh, package="ts")
predict(arima(lh, order = c(3,0,0)), n.ahead = 12)

data(USAccDeaths, package="ts")
(fit <- arima(USAccDeaths, order = c(0,1,1),
              seasonal = list(order=c(0,1,1))))
predict(fit, n.ahead = 6)
\end{ExampleCode}
\end{Examples}

