Skip to content

Model Information

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

Model Information Methods

This page documents methods for extracting information about fitted smooth models, including dimensions, types, and structural components.

Note: None of this is yet implemented in Python.

Summary Table

Function Returns Type
nobs() Number of observations integer
nparam() Parameter counts matrix
sigma() Residual standard deviation numeric
extractScale() Scale parameter(s) numeric/vector
errorType() Error type ("A" or "M") character
modelType() Model specification character
modelName() Full model name character
orders() ARIMA orders list
lags() Model lags numeric vector
formula() Measurement equation formula formula

Basic Model Information

nobs()

Returns the number of observations used in model estimation.

R Usage

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

# Number of observations
nobs(model)  # 132 (144 - 12 holdout)

Note

When holdout=TRUE, nobs() returns the number of in-sample observations (excluding holdout).

nparam()

Returns the number of estimated parameters in the model, broken down by category.

R Usage

model <- adam(AirPassengers, "MMM", lags=12)

# Number of estimated parameters
nparam(model)

Example

model <- adam(AirPassengers, "MAM", lags=12)
nparam(model)

The more detailed information about parameters can be accessed via:

model$nParam

Scale of the model

sigma()

Returns the residual standard deviation (scale parameter) of the model.

R Usage

model <- adam(AirPassengers, "MMM", lags=12)

# Residual standard deviation
sigma(model)

Note

The scale of the sigma depends on the type of the error in the model. If it was the additive error, the scale will be in the original units. If it was the multiplicative one, sigma will have the interpretation closer to variability percents.

extractScale()

Extracts the scale parameter from the model, including time-varying scale if a Scale-Model was fitted.

R Usage

# Basic model
model <- adam(AirPassengers, "MMM", lags=12)
extractScale(model)  # Single value

# With scale model
scaleModel <- sm(model, model="MNM", lags=12)
fullModel <- implant(model, scaleModel)
extractScale(fullModel)  # Time series of scale values

Model Design Information

errorType()

Extracts the type of error term: additive ("A") or multiplicative ("M").

R Usage

model <- adam(AirPassengers, "MMM", lags=12)

errorType(model)  # "M"

model <- adam(AirPassengers, "AAN", lags=12)

errorType(model)  # "A"

modelType()

Extracts the type of the estimated ETS model.

R Usage

# ETS model
model <- adam(AirPassengers, "MMM", lags=12)
modelType(model)  # "MMM"

# With damping
model <- adam(AirPassengers, "MAdM", lags=12)
modelType(model)  # "MAdM"

# CES model
model <- ces(AirPassengers, "f")
modelType(model)  # "CES(f)"

modelName()

Returns the full descriptive name of the fitted model.

R Usage

# ETS model
model <- adam(AirPassengers, "MMM", lags=12)
modelName(model)  # "ETS(M,M,M)"

# ARIMA
model <- adam(BJsales, "NNN", orders=list(ar=1, i=1, ma=1))
modelName(model)  # "ARIMA(1,1,1)"

# Combined ETS+ARIMA
model <- adam(AirPassengers, "AAN", lags=12, orders=c(1,0,1))
modelName(model)  # "ETS(A,A,N)+ARIMA(1,0,1)"

orders()

Extracts the orders of ARIMA components (ar, i, ma).

R Usage

# ARIMA model
model <- adam(BJsales, "NNN", orders=list(ar=c(1,1), i=c(1,1), ma=c(1,1)),
              lags=c(1,12))

orders(model)
# $ar
# [1] 1 1
#
# $i
# [1] 1 1
#
# $ma
# [1] 1 1

Also works for gum() and will return the orders used in the model.

Note

For pure ETS models, orders() returns zero orders.

lags()

Extracts the lags used in the model.

R Usage

# Model with multiple seasonalities
model <- adam(y, "MAM", lags=c(1, 24, 168))

lags(model)  # [1] 1 24 168

# ARIMA lags
model <- adam(BJsales, "NNN", orders=list(ar=c(1,1), i=c(1,1), ma=c(1,1)),
              lags=c(1,12))

lags(model)  # [1] 1 12

formula()

Returns the formula for the measurement equation of the model.

R Usage

model <- adam(AirPassengers, "MAM", lags=12)
formula(model)

# For ADAM with regressors
model <- adam(y ~ x1 + x2, data=df, model="AAN")
formula(model)  # Returns the actual regression formula

Note

For adam(), this returns a proper formula object that can be used in further estimation. For other smooth functions (es(), ces(), etc.), the formula is decorative and mainly useful for display purposes.

See Also

Clone this wiki locally