Skip to content

SSARIMA

Ivan Svetunkov edited this page Jan 30, 2026 · 7 revisions

SSARIMA - State Space ARIMA

SSARIMA (State Space ARIMA) implements ARIMA models using the Single Source of Error (SSOE) state-space framework. This allows for consistent treatment with other smooth package models and proper handling of prediction intervals.

Note: Not yet implemented in Python.

Overview

The function constructs ARIMA(p,d,q) models and their seasonal extensions SARIMA(p,d,q)(P,D,Q)[m] in state-space form, enabling:

  • Direct order selection without statistical test
  • Combination with ETS components via ADAM
  • Consistent prediction interval methodology
  • External regressors with adaptive coefficients

Mathematical Form

This is the formulation first introduced by Hyndman et al. (2008), Chapter 11. See details in Svetunkov (2023), Chapter 8 and in Subsection 19.2.2.

R Usage

library(smooth)

# Basic ARIMA(1,1,1)
ssarima(y, orders=c(ar=1, i=1, ma=1), lags=1)

# Using vector notation for non-seasonal ARIMA
ssarima(y, orders=c(1,1,1))

# SARIMA(1,1,1)(1,1,1)[12]
ssarima(y, orders=list(ar=c(1,1), i=c(1,1), ma=c(1,1)), lags=c(1,12))

# SARIMA(2,0,0)(1,0,0)[4]
ssarima(y, orders=list(ar=c(2,1)), lags=c(1,4))

# With holdout validation
ssarima(y, orders=list(ar=1, i=1, ma=c(1,1)), lags=c(1,4), h=18, holdout=TRUE)

# Reuse a previous model on new data
model1 <- ssarima(y1, orders=list(ar=1, i=1, ma=1))
ssarima(y2, model=model1)

Automatic Order Selection

# Automatic ARIMA order selection
auto.ssarima(y, h=12, holdout=TRUE)

# With maximum orders specified
auto.ssarima(y, orders=list(ar=c(3,2), i=c(2,1), ma=c(3,2)), lags=c(1,12))

# More exhaustive search (slow)
auto.ssarima(y, h=12, holdout=TRUE, fast=FALSE)

Parameters of SSARIMA

Parameter Type (R) Default Description
y vector/ts - Time series data
orders list/vector list(ar=0,i=1,ma=1) ARIMA orders
lags numeric vector c(1, frequency(y)) Lags for each order
constant logical/numeric FALSE Include constant/drift
arma list/vector NULL Fixed AR/MA parameters
initial character "backcasting" Initialization method
loss character "likelihood" Loss function
h integer 0 Forecast horizon
holdout logical FALSE Use holdout validation
bounds character "admissible" Parameter bounds
xreg matrix NULL External regressors
regressors character "use" How to handle regressors

Orders Specification

Orders are specified as a list with ar, i, and ma components:

# SARIMA(1,1,1)(0,1,1)[12]
orders = list(ar=c(1,0),
              i=c(1,1),
              ma=c(1,1))
lags = c(1, 12)

# SARIMA(1,0,1)(1,0,1)[24](0,1,1)[168]
orders = list(ar=c(1,1,0),
              i=c(0,0,1),
              ma=c(1,1,1))
lags = c(1, 24, 168)

Initialization Methods

  • "backcasting": Recommended for high-frequency data
  • "optimal": Optimize all initial states
  • "two-stage": Backcast then optimize
  • "complete": Full backcasting including regressors

Bounds

  • "admissible": Guarantee model stability
  • "usual": AR/MA parameters between -1 and 1
  • "none": No restrictions (use with caution)

With External Regressors

# ARIMAX model
ssarima(y, orders=list(ar=1, i=1, ma=1), xreg=X)

# Automatic regressor selection
ssarima(y, orders=list(ar=1, i=1, ma=1), xreg=X, regressors="select")

# Adaptive regressors
ssarima(y, orders=list(ar=1, i=1, ma=1), xreg=X, regressors="adapt")

Output

Returns an object of class "adam" containing:

Element Type (R) Description
model character Model name (e.g., "ARIMA(1,1,1)")
arma list List of AR/MA parameters
orders list Order specification
constant numeric Constant/drift value
states matrix State matrix
persistence vector Persistence vector
transition matrix Transition matrix F
measurement vector Measurement vector w
fitted vector Fitted values
forecast vector Point forecasts
residuals vector Model residuals
logLik numeric Log-likelihood value
lags vector Lags used in the model

Performance Note

For multiple seasonal frequencies, MSARIMA is more computationally efficient than SSARIMA. Consider using MSARIMA or ADAM directly for complex seasonal structures.

References

  • Svetunkov, I., & Boylan, J.E. (2019). State-space ARIMA for supply-chain forecasting. International Journal of Production Research, 58(3), 818-827. DOI: 10.1080/00207543.2019.1600764
  • Hyndman, R.J., Koehler, A.B., Ord, J.K., Snyder, R.D., 2008. Forecasting with Exponential Smoothing: The State Space Approach. Springer Berlin Heidelberg. DOI: 10.1007/978-3-540-71918-2.

See Also

Related Functions

  • ADAM - Unified framework (recommended)
  • MSARIMA - More efficient for multiple seasonalities
  • ES - Exponential Smoothing

Parameter Documentation

Clone this wiki locally