sparma: Sparse ARMA Model in State Space Form

View source: R/sparma.R

sparmaR Documentation

Sparse ARMA Model in State Space Form

Description

Implements a Sparse ARMA model in the State Space form. Unlike standard ARIMA which expands polynomials, this function directly maps AR and MA orders to specific lags.

Usage

sparma(data, orders = list(ar = c(1), ma = c(1)), constant = FALSE,
  loss = c("likelihood", "MSE", "MAE", "HAM", "LASSO", "RIDGE", "MSEh",
  "TMSE", "GTMSE", "MSCE", "GPL"), h = 0, holdout = FALSE, arma = NULL,
  initial = c("backcasting", "optimal", "two-stage", "complete"),
  bounds = c("none", "usual", "admissible"), silent = TRUE, ...)

Arguments

data

Vector or ts object with the data

orders

List with vectors for ar and ma, specifying, which AR and MA orders to fit e.g. orders=list(ar=c(1,4), ma=0) will fit ARMA y_{t} = phi_1 y_{t-1} + phi_4 y_{t-4} + e_t

constant

Logical, whether to include a constant term (default: FALSE)

loss

Loss function type.

h

Forecast horizon (default: 0)

holdout

Logical, whether to use holdout sample (default: FALSE)

arma

List with ar and ma parameters if they do not need to be estimated

initial

Initialisation method for states

bounds

Parameter bounds

silent

Logical, whether to suppress output (default: TRUE)

...

Other parameters passed to god knows what.

Details

The model implements:

y_t = phi * y_{t-p} + theta * epsilon_{t-q} + epsilon_t

with a possibility of defining several lags for AR/MA.

Value

Object of class c("adam", "smooth") containing:

  • model - Model name

  • timeElapsed - Computation time

  • data - Input data

  • holdout - Holdout sample (if applicable)

  • fitted - Fitted values

  • residuals - Residuals

  • forecast - Point forecasts if h>0

  • states - State matrix

  • persistence - Persistence vector (g)

  • transition - Transition matrix (F)

  • measurement - Measurement matrix (W)

  • B - Vector of estimated parameters

  • orders - Orders specified by the user

  • constant - Constant value (if included)

  • arma - vector of ARMA parameters

  • initial - Initial state values

  • initialType - Type of initialisation

  • nParam - Number of parameters

  • logLik - Log-likelihood value

  • loss - Loss function used in the estimation

  • lossValue - Value of the loss function

  • accuracy - Accuracy measures

Examples

## Not run: 
# Fit SpARMA(1,1) model
model <- sparma(BJSales, orders=c(2,1), h=12, holdout=TRUE)

# Provide fixed parameters
model <- sparma(rnorm(100), orders=c(1,1), arma=c(0.7,0.5))

## End(Not run)


smooth documentation built on Feb. 5, 2026, 5:08 p.m.