auto_issm: Automatic Model Selection

View source: R/selection.R

auto_issmR Documentation

Automatic Model Selection

Description

Automatic model selection based on the AIC criterion.

Usage

auto_issm(
  y,
  slope = c(TRUE, FALSE),
  slope_damped = c(TRUE, FALSE),
  seasonal = c(TRUE, FALSE),
  seasonal_frequency = 1,
  seasonal_type = "trigonometric",
  seasonal_harmonics = list(),
  ar = 0:2,
  ma = 0:2,
  xreg = NULL,
  transformation = "box-cox",
  lambda = 1,
  lower = 0,
  upper = 1,
  sampling = NULL,
  trace = FALSE,
  return_table = FALSE,
  solver = "nlminb",
  autodiff = TRUE,
  ...
)

Arguments

y

an xts vector.

slope

whether to include or not the slope. Having both TRUE and FALSE will estimate all possible combinations with and without a slope.

slope_damped

whether to include or not the slope dampening. Having both TRUE and FALSE will estimate all possible combinations with and without slope dampening.

seasonal

whether to include or not a seasonal component. Having both TRUE and FALSE will estimate all possible combinations with and without a seasonal component.

seasonal_frequency

a vector of seasonal frequencies.

seasonal_type

The type of seasonality to include. Trigonometric is the preferred type and the only one accepting multiple seasonal frequencies.

seasonal_harmonics

a list with slots for each seasonal frequency listing the sequence of harmonics to test for each (see details).

ar

a vector of the ar terms to test for (see details).

ma

a vector of the ma terms to test for (see details).

xreg

an optional xts matrix of regressors (pre-lagged).

transformation

The transformation to use (defaults to box-cox and is effectively NULL if lambda is NULL or 1).

lambda

the box-cox lambda parameter.

lower

the lower bound for the transformation.

upper

the upper bound for the transformation.

sampling

the sampling frequency of the data.

trace

whether to show the progress bar. The user is expected to have set up appropriate handlers for this using the “progressr” package.

return_table

Whether to return the table with the enumerated options and the AIC and MAPE for each combination of those options used.

solver

the solver to use for estimation.

autodiff

whether to use automatic differentiation (see estimate.tsissm.spec).

...

not used.

Details

The user is responsible for passing reasonable options for the options. For instance, the harmonics must be strictly positive and less than one half the seasonal frequency. The expand.grid function is used to enumerate all possible combinations of the options with some sanity checks and eliminations if testing for both seasonal and non-seasonal models, or for the case of slope and dampening. If the user prefers to ensemble models or use instead the MAPE criterion, the ‘return_table’ should be set to TRUE and the returned table used to estimate an alternative to the top AIC model.

Value

An object of class “tsissm.estimate” returning the best model based on AIC (minimum).

Note

The function can use parallel functionality as long as the user has set up a plan using the future package.


tsmodels/tsissm documentation built on Oct. 15, 2022, 6:44 a.m.