Skip to content

Model Estimation

Ivan Svetunkov edited this page Feb 11, 2026 · 8 revisions

Model Estimation

This page documents the estimation parameters shared across ADAM and related functions. These parameters control the optimisation process, initial values, and advanced estimation options.

NLopt Optimizer Parameters

The smooth package uses NLopt for numerical optimisation. These parameters control the optimisation behaviour:

Parameter R (via ...) Python (via nlopt_kargs) Default Description
algorithm Yes Yes "NLOPT_LN_NELDERMEAD" Optimiser algorithm
maxeval Yes Yes 40×len(B) Maximum evaluations
maxtime Yes Yes None/1800s Maximum time (seconds)
xtol_rel Yes Yes 1e-6 Relative parameter tolerance
xtol_abs Yes Yes 1e-8 Absolute parameter tolerance
ftol_rel Yes Yes 1e-8 Relative function tolerance
ftol_abs Yes Yes 0 Absolute function tolerance
print_level Yes Yes 0 Verbosity (0=silent, 3=detailed, 41=initials + final output)

The parameters are documented in the nlopt project.

R Usage

# Pass NLopt parameters via ...
model <- adam(y, model="AAN",
              algorithm="NLOPT_LN_SBPLX",
              maxeval=1000,
              maxtime=600,
              xtol_rel=1e-8,
              print_level=1)

Python Usage

# Pass NLopt parameters via nlopt_kargs dict
model = ADAM(model="AAN", nlopt_kargs={
             "algorithm": "NLOPT_LN_SBPLX",
             "maxeval": 1000,
             "maxtime": 600,
             "xtol_rel": 1e-8,
             "print_level": 1
})
model.fit(y)

Initial Parameter Vector (B)

The parameter vector B contains all estimated parameters in a specific order:

  1. Smoothing parameters (alpha, beta, gamma, delta)
  2. Damping parameter (phi)
  3. ARMA coefficients
  4. Initial ETS states
  5. Initial ARIMA states
  6. External regressor coefficients (for xreg)

R Usage

# Provide initial values, lower and upper bounds
# Initial states are captured via backcasting, so not provided
model <- adam(y, model="AAN",
              B=c(0.3, 0.1),        # Initial parameter values
              lb=c(0, 0),           # Lower bounds
              ub=c(1, 1))           # Upper bounds

Python Usage

# Provide initial values and bounds via dicts
model = ADAM(model="AAN",
          nlopt_initial={"persistence": [0.3, 0.1]},
          nlopt_lower={"persistence": [0, 0]},
          nlopt_upper={"persistence": [1, 1]})
model.fit(y)

See Bounds for details on parameter boundaries and stability restrictions.

Smoother Parameter

The smoother parameter controls how msdecompose smooths the time series for initialisation. Available options:

Value R Python Description
"lowess" Yes Yes LOcally WEighted Scatterplot Smoothing (default)
"ma" Yes Yes Moving Average
"supsmu" Yes No Friedman's SuperSmoother
"global" Yes Yes Global mean (no smoothing)

R Usage

model <- adam(y, model="AAN", smoother="lowess")

Python Usage

model = ADAM(model="AAN", smoother="lowess")
model.fit(y)

See msdecompose for more details on the decomposition process.

Fisher Information (R only)

The Fisher Information matrix can be computed for uncertainty quantification:

Parameter Default Description
FI FALSE Whether to compute Fisher Information matrix
stepSize ~1.22e-4 Step size for Hessian calculation

R Usage

model <- adam(y, model="AAN",
              FI=TRUE,
              stepSize=1e-5)

# Access Fisher Information
model$FI

The Fisher Information is used for computing standard errors and confidence intervals of parameters. This is done automatically by the vcov() method in R, see Coefficients-and-Parameters.

Backcasting Iterations

Backcasting is used to refine initial state estimates by iterating between forward and backward passes:

Parameter R Python Default Description
nIterations Yes - 2 Number of backcasting iterations
n_iterations - Yes 2 Number of backcasting iterations

R Usage

model <- adam(y, model="AAN", nIterations=5)

Python Usage

model = ADAM(model="AAN", n_iterations=5)
model.fit(y)

Higher values may improve initial state estimates but increase computation time.

Related Pages

  • Initialisation - State initialisation methods
  • Loss-Functions - Loss functions for estimation
  • Bounds - Parameter bounds and stability
  • ADAM - Main ADAM function documentation
  • ES - Exponential Smoothing documentation

Clone this wiki locally