Skip to content

Initialisation

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

title: Initialisation slug: Initialisation summary: The initial parameter: backcasting, optimal, two-stage, complete, or user-provided initial states. status: stable applies_to: [adam, es] related: [ADAM, msdecompose, Persistence]

Initialisation

This page documents the initial parameter and initialisation methods used across smooth models.

At a glance

Field Value
Argument name initial
Type string, or list / dict of numeric vectors
Valid values (string) "backcasting", "optimal", "two-stage", "complete"
Valid values (provided) R: list(level=…, trend=…, seasonal=…, xreg=…, arima=…). Python: dict with the same keys.
Default "backcasting"
Applies to R: adam, auto.adam, es, ces, msarima, ssarima, gum, om, omg. Python: ADAM, AutoADAM, ES, CES, MSARIMA, OM, OMG.

The initial Parameter

The initial parameter controls how initial state values are determined before model estimation begins.

Basic Usage

R

# Use backcasting (default)
model <- adam(y, model="AAA", lags=12, initial="backcasting")

# Optimize all initial states
model <- adam(y, model="AAA", lags=12, initial="optimal")

Python

# Use backcasting (default)
model = ADAM(model="AAA", lags=12, initial="backcasting")

# Optimize all initial states
model = ADAM(model="AAA", lags=12, initial="optimal")

Initialisation Methods

Method Description Speed Recommended For
"backcasting" Initialize via backcasting procedure Fast High-frequency data, large datasets
"optimal" Optimize all initial states Slow Short series, when accuracy is critical
"two-stage" Backcast first, then optimize Slower Refine the initials, gain in accuracy
"complete" Full backcasting including regressors Fast ETSX/ARIMAX models on large datasets

Backcasting ("backcasting")

The default method. Runs the model forward and backwards through the data to estimate initial states:

  1. Start from the beginning of the data, apply the model
  2. Revert the model and move from the end of the series to the beginning
  3. Use the resulting states as initial values

Note: This method still estimates the values of the parameters for the explanatory variables.

Advantages:

  • Fast, especially for long series
  • Works well for high-frequency data
  • Provides reasonable starting points
  • Requires fewer parameters to estimate

When to use: Default choice for most situations, especially with high-frequency or long series.

model <- adam(y, model="AAA", lags=12, initial="backcasting")
model = ADAM(model="AAA", lags=12, initial="backcasting")

Advanced: Number of Iterations

The number of iterations in backcasting can be controlled via the nIterations parameter:

model <- adam(y, model="AAA", lags=12, initial="backcasting", nIterations=2)
model = ADAM(model="AAA", lags=12, initial="backcasting", n_iterations=2)

Default is 2 iterations, which suffices in the majority of cases. Larger values will slow down the estimation.

Optimal ("optimal")

All initial states are treated as parameters and optimized along with other model parameters:

  1. Initial states are included in the parameter vector
  2. Optimizer finds values that minimize the loss function
  3. Results in potentially better fit but more parameters to estimate

Advantages:

  • Can improve fit for short series
  • This is the default approach in all the other ETS implementations

Disadvantages:

  • Slower, especially for seasonal models with long lags and large datasets
  • More parameters to estimate
  • Parameter estimates for initial states are neither efficient, nor consistent
  • Might become a nightmare in case of large order ARIMA

When to use: Short time series where initial states significantly impact the fit.

model <- adam(y, model="AAA", lags=12, initial="optimal")
model = ADAM(model="AAA", lags=12, initial="optimal")

Two-Stage ("two-stage")

Combines backcasting and optimization:

  1. First, perform backcasting to get initial estimates
  2. Then, refine these estimates through optimization

Advantages:

  • Better starting point for optimization
  • Can achieve better fit than pure backcasting

Disadvantages:

  • The same as in case of "optimal".

When to use: When you want a better model fit, and are not satisfied with the "optimal" ones.

model <- adam(y, model="AAA", lags=12, initial="two-stage")
model = ADAM(model="AAA", lags=12, initial="two-stage")

Complete ("complete")

Full backcasting that also initializes explanatory variable coefficients:

  1. Backcast all states including regressor parameters
  2. No optimization of initial values for ETS/ARIMA components

Advantages:

  • Fast for models with regressors
  • Consistent treatment of all components

Disadvantages:

  • Estimates of parameters for explanatory variables might be biased

When to use: ETSX, ARIMAX, or other models with explanatory variables.

R

model <- adam(data, model="AAN", formula=y~x1+x2, initial="complete")

Python

model = ADAM(model="AAN", regressors="use", initial="complete")
model.fit(y, X)

Providing Custom Initial Values

Instead of using a character method, you can provide specific initial values.

Available Components

Component Description Required For
level Initial level value All ETS models
trend Initial trend value ETS models with trend (A, Ad, M, Md)
seasonal List/Vector of seasonal indices Seasonal ETS models
arima Initial ARIMA states ARIMA components
xreg Initial regressor coefficients Models with explanatory variables

R: As a Named List (Recommended)

# R: Provide specific initial values
model <- adam(y, model="AAA", lags=12,
              initial=list(
                  level=100,
                  trend=1,
                  seasonal=c(0.9, 1.0, 1.1, 0.95, 1.05, 0.98,
                            1.02, 0.97, 1.03, 0.96, 1.04, 1.0)
              ))

In case of several seasonal components, the list of components should be passed to seasonal with each element including a vector of components for respective lags.

Python: Dictionary

# Python: Provide initial values as dictionary
model = ADAM(model="AAA", lags=12,
             initial={"level": 100, "trend": 1, "seasonal": [0.9, 1.0, 1.1, ...]})

Partial Specification

If some components are provided but others are missing, the missing ones will be estimated:

# Provide level, estimate everything else
model <- adam(y, model="AAA", lags=12,
              initial=list(level=100))
model = ADAM(model="AAA", lags=12,
             initial={"level": 100})

As a Vector

Components can also be provided as a vector in the order: level, trend, seasonal, ARIMA, xreg (with no gaps).

R

# Order: level, trend, 12 seasonal values
init_vec <- c(100, 1, 0.9, 1.0, 1.1, 0.95, 1.05, 0.98, 1.02, 0.97, 1.03, 0.96, 1.04, 1.0)
model <- adam(y, model="AAA", lags=12, initial=init_vec)

Python

Note: Providing initial values as a plain vector is not supported in Python. Use a dictionary instead (see "As a Named List/Dict" above).

R, ES specific

In R, The initialSeason parameter (in ES) allows specifying initial seasonal values separately:

# R: ES with specific seasonal initials
model <- es(y, model="AAA", lags=12,
            initialSeason=c(0.9, 1.0, 1.1, 0.95, 1.05, 0.98,
                           1.02, 0.97, 1.03, 0.96, 1.04, 1.0))

Accessing Initial Values

After fitting, you can access the initial values used:

# R: Access initial values
model <- adam(y, model="AAA", lags=12)
model$initial          # Named list of initial values
model$initialType      # Method used ("backcasting", "optimal", etc.)
model$initialEstimated # Which components were estimated
# Python: Access initial values
model = ADAM(model="AAA", lags=12)
model.fit(y)
model.initial_states_  # Initial state values

Recommendations

  1. Default: Use "backcasting" - it's fast and usually sufficient
  2. Short series: Consider "optimal" if you don't like the model fit from "backcasting"
  3. With regressors: If the sample size is large and you don't want to wait, use "complete"
  4. Domain knowledge: If you know reasonable initial values, provide them
  5. Numerical issues: If estimation fails, try different initialization methods

References

  • Svetunkov, I. (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM). Online: https://openforecast.org/adam/
  • Hyndman, R.J., et al. (2008). Forecasting with Exponential Smoothing: The State Space Approach. Springer.

See Also

Clone this wiki locally