Similar to other predict methods, this function predicts fitted values from a fitted "ARIMA" object.

# S3 method for ARIMA
predict(
  model,
  data = NULL,
  key = NULL,
  forecast.method = NULL,
  forecast.length = NULL,
  ...
)

Arguments

model

R6Class object
An "ARIMA" object for prediction.

data

DataFrame, optional
Includes the ID column and external Data (exogeneous variables) for prediction.
Defaults to NULL.

key

character, optional
Name of the key in the data.
Defaults to NULL and if data is not NULL and key is not provided, defaults to the first column.

forecast.method

{"formula.forecast", "innovations.algorithm"}, optional
Store information for the subsequent forecast method.

  • "formula.forecast": compute future series via formula.

  • "innovations.algorithm": apply innovations algorithm to compute future series, which requires more original information to be stored


Defaults to "innovations.algorithm".

forecast.length

integer, optional
Number of points to forecast.
Defaults to 1.

...

Reserved parameter.

Format

S3 methods

Value

Predicted values are returned as a DataFrame, structured as follows:

  • ID: with same name and type the ID column of data.

  • FORECAST: type DOUBLE, representing predicted values.

  • SE: type DOUBLE, standard error.

  • LO80: type DOUBLE, low 80% values.

  • HI80: type DOUBLE, high 80% values.

  • LO95: type DOUBLE, low 95% values.

  • HI95: type DOUBLE, high 95% values.

Examples

Apply predict on an "arima" object arm and obtain the result:

> res <- predict(arm,
                 forecast.method="innovations.algorithm",
                 forecast.length = 10)

   TIMESTAMP   FORECAST       SE       LO80       HI80       LO95       HI95
1          0  1.5577828 1.302436 -0.1113569  3.2269225 -0.9949452  4.1105108
2          1  3.7659871 1.315333  2.0803200  5.4516542  1.1879826  6.3439917
3          2 -0.5655989 1.315333 -2.2512660  1.1200682 -3.1436035  2.0124056
4          3 -3.6198158 1.315333 -5.3054829 -1.9341487 -6.1978203 -1.0418112
......

See also