Skip to content

Scale Model

Ivan Svetunkov edited this page Jun 16, 2026 · 5 revisions

title: Scale Model (sm) slug: Scale-Model summary: sm() models the scale (variance) of the error term dynamically; R-only, see Roadmap. status: R-only applies_to: [adam] related: [ADAM, Roadmap]

Scale Model (sm)

The sm() function creates a model for the scale (variance) of the error term based on a fitted ADAM model. This allows modelling heteroscedasticity using ETS or ARIMA (with explanatory variables) structures for the scale parameter, similar to GARCH or GAMLSS approaches.

Note: The scale model currently only works with models estimated via maximum likelihood (loss="likelihood").

Note: This is not yet implemented in Python.

Overview

In many time series, the variance of errors changes over time (heteroscedasticity). The scale model extends ADAM by:

  • Modelling the scale parameter dynamically over time
  • Supporting ETS and ARIMA structures for scale dynamics
  • Allowing explanatory variables to affect variance
  • Enabling automatic model selection for the scale component

The function prepares the data and then calls adam() to fit the scale model.

Mathematical Framework

For a location model:

y_t = μ_t + σ_t × ε_t

The scale model estimates σ_t dynamically:

σ_t = f(states, regressors)

where f() can follow ETS, ARIMA, or regression structures.

R Usage

Basic Scale Model

# Step 1: Fit location model
locationModel <- adam(AirPassengers, "MMM", h=12, holdout=TRUE)

# Step 2: Fit scale model
scaleModel <- sm(locationModel, model="YYY")

# Step 3: Examine results
scaleModel

With Explanatory Variables

# Fit location model with regressors
data <- cbind(y, x1, x2)
locationModel <- adam(data, "AAN", h=12, holdout=TRUE)

# Scale model with regressor selection
scaleModel <- sm(locationModel, model="NNN",
                 formula=~x1+x2,
                 regressors="select")

Integrating Scale with Location Model

# After fitting both models separately
locationModel <- adam(AirPassengers, "MMM", lags=12)
scaleModel <- sm(locationModel, model="YYY")

# Merge them
mergedModel <- implant(locationModel, scaleModel)

# New output in comparison with just location model
mergedModel

# Access scale information
mergedModel$scale
extractScale(mergedModel)

Parameters

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

Parameter Type Default Description
object adam Fitted ADAM model.
model character "YYY" ETS model for scale ("NNN" for no dynamics).
lags numeric vector NULL Lags for seasonal scale components.
orders list NULL ARIMA orders for scale.
formula formula NULL Formula for explanatory variables.
regressors character "use" How to handle regressors: "use", "select", "adapt".
persistence numeric vector NULL Fixed smoothing parameters.
phi numeric NULL Fixed damping parameter.
initial character "backcasting" Initialisation method.
ic character "AICc" Information criterion.
bounds character "usual" Parameter bounds.
silent logical TRUE Suppress output.

Output

The sm() function returns an object of class "adam" with additional scale-specific components:

Element Type (R) Description
model character Scale model specification
scale numeric vector Estimated scale values over time
fitted numeric vector Fitted scale values
forecast numeric vector Scale forecasts
states matrix Scale states
persistence numeric vector Scale smoothing parameters
logLik numeric Log-likelihood

Examples

Example 1: Automatic Scale Model Selection

# Fit location model
locationModel <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)

# Automatic selection among multiplicative ETS for scale
scaleModel <- sm(locationModel, model="YYY")
scaleModel

# View scale estimates
plot(scaleModel$scale, type="l", main="Estimated Scale Over Time")

Example 2: Scale Model with Regressors

# Prepare data with explanatory variables
library(datasets)
data <- cbind(Seatbelts[,"DriversKilled"],
              Seatbelts[,c("law","PetrolPrice")])
colnames(data)[1] <- "drivers"

# Fit location model
locationModel <- adam(data, "AAN", h=12, holdout=TRUE)

# Scale model with regressor selection
scaleModel <- sm(locationModel, model="NNN",
                 formula=drivers~law+PetrolPrice,
                 regressors="select")
scaleModel

Example 3: Complete Workflow

# 1. Fit location model
locationModel <- adam(AirPassengers, "MMM", lags=12)
summary(locationModel)

# 2. Check for heteroscedasticity
plot(locationModel, which=8)  # Squared residuals vs Fitted

# 3. Fit scale model
scaleModel <- sm(locationModel, model="MNM", lags=12)

# 4. Merge models
fullModel <- implant(locationModel, scaleModel)

# 5. Generate forecasts with scale
fullModelForecast <- forecast(fullModel, h=24, interval="prediction")
plot(fullModelForecast)

Example 4: ARIMA Scale Model

# Location model
locationModel <- adam(BJsales, "AAN", h=12, holdout=TRUE)

# ARIMA(1,0,1) for scale
scaleModel <- sm(locationModel, model="NNN",
                 orders=list(ar=1, i=0, ma=1))
scaleModel

Model Selection Guidelines

When to Use Scale Models

  • Residual variance appears to change over time
  • Squared residuals show patterns (check plot(model, which=8))
  • ACF of squared residuals shows significant autocorrelation (check plot(model, which=9))
  • You need prediction intervals that adapt to changing variance

Choosing Scale Model Type

Pattern Recommended Model
Constant variance No scale model needed
Slowly changing variance model="MNN"
Seasonal variance model="MNM"
Variance depends on level model="YYY" (automatic selection)
Variance depends on covariates model="NNN" with formula

Comparison with GARCH

Feature sm() Traditional GARCH
Framework State space (ETS/ARIMA) ARMA for variance
Seasonality Native support Requires extensions
Regressors Supported Limited
Forecasting Integrated with location Separate
Interpretation Smoothing parameters ARCH/GARCH coefficients

Important Notes

  1. Likelihood estimation required: Scale models only work when loss="likelihood" was used for the location model.

  2. Estimation order: Always fit the location model first, then the scale model.

  3. Model complexity: Adding a scale model increases the number of estimated parameters. Use information criteria to check if it improves the model.

  4. Multiplicative errors: Scale models are particularly useful for multiplicative error models where variance is proportional to level.

References

See Also

Clone this wiki locally