Skip to content

SSARIMA

Ivan Svetunkov edited this page Jul 6, 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.

R-only. SSARIMA is not yet ported to Python — see Roadmap. Use MSARIMA in Python for a faster, more general ARIMA implementation.

Function signature (R)

ssarima(y, orders = list(ar = c(0), i = c(1), ma = c(1)),
        lags = c(1, frequency(y)),
        constant = FALSE, arma = NULL, model = NULL,
        initial = c("backcasting", "optimal", "two-stage", "complete"),
        loss = c("likelihood", "MSE", "MAE", "HAM",
                 "MSEh", "TMSE", "GTMSE", "MSCE", "GPL"),
        h = 0, holdout = FALSE,
        bounds = c("admissible", "usual", "none"),
        silent = TRUE,
        xreg = NULL, regressors = c("use", "select", "adapt"),
        initialX = NULL, ...)

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

The formulation was first introduced by Hyndman et al. (2008) and extended in Svetunkov (2023); see References.

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

R-only. SSARIMA is not yet ported to Python — see Roadmap. All parameters below are R-side only.

Parameter Type 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" Initialisation 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 (R only):

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

See Also

Related Functions

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

Parameter Documentation

Clone this wiki locally