forecast.msarima: Forecast from a Multi-Seasonal ARIMA Model

View source: R/forecast.R

forecast.msarimaR Documentation

Forecast from a Multi-Seasonal ARIMA Model

Description

Returns forecasts and prediction intervals for a fitted multi-seasonal ARIMA model.

Usage

## S3 method for class 'msarima'
forecast(object, h = 10, level = c(80, 95), fan = FALSE, ...)

Arguments

object

An object of class "msarima".

h

Number of periods to forecast. Default is 10.

level

Confidence levels for the prediction intervals, in percent. Default is c(80, 95).

fan

If TRUE, level is set to seq(51, 99, by = 3), which is suitable for fan plots. Default is FALSE.

...

Additional arguments (currently not used).

Details

Point forecasts are computed by running the model recursion forward, setting the future innovations to zero. Differencing and the constant term, when present, are taken from the fitted model, so the forecasts are on the scale of the original series.

Prediction intervals assume Gaussian innovations. The forecast variance V_h is obtained from the MA(\infty) representation of the model.

Value

An object of class "forecast" containing the following elements:

method

The name of the forecasting method (same as object$method).

model

The fitted "msarima" model object.

level

The confidence levels for prediction intervals (as percentages).

mean

Point forecasts as a time series (ts or msts object).

lower

Lower limits for prediction intervals. Matrix with one column for each confidence level specified in level.

upper

Upper limits for prediction intervals. Matrix with one column for each confidence level specified in level.

x

The original time series.

series

The name of the series.

fitted

Fitted values from the model.

residuals

Residuals from the model.

See Also

msarima, simulate.msarima

Examples

# Simulate and fit model
set.seed(123)
y <- msarima.sim(nsim = 200,
                 order = c(1, 0, 0),
                 seasonal = list(c(1, 0, 0), c(0, 0, 1)),
                 seasonal.period = c(4, 11),
                 ar = c(0.5, 0.5), ma = 0.3, sigma2 = 1)

fit <- msarima(y, order = c(1, 0, 0),
               seasonal = list(c(1, 0, 0), c(0, 0, 1)),
               seasonal.period = c(4, 11))

# Forecast 20 steps ahead with default confidence levels (80%, 95%)
fc <- forecast(fit, h = 20)
print(fc)

# Forecast with custom prediction intervals
fc2 <- forecast(fit, h = 20, level = c(90, 95, 99))


msarima documentation built on Nov. 12, 2026, 5:11 p.m.