-
Notifications
You must be signed in to change notification settings - Fork 22
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.
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.
# Pass NLopt parameters via ...
model <- adam(y, model="AAN",
algorithm="NLOPT_LN_SBPLX",
maxeval=1000,
maxtime=600,
xtol_rel=1e-8,
print_level=1)# 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)The parameter vector B contains all estimated parameters in a specific order:
- Smoothing parameters (alpha, beta, gamma, delta)
- Damping parameter (phi)
- ARMA coefficients
- Initial ETS states
- Initial ARIMA states
- External regressor coefficients (for xreg)
# 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# 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.
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) |
model <- adam(y, model="AAN", smoother="lowess")model = ADAM(model="AAN", smoother="lowess")
model.fit(y)See msdecompose for more details on the decomposition process.
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 |
model <- adam(y, model="AAN",
FI=TRUE,
stepSize=1e-5)
# Access Fisher Information
model$FIThe 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 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 |
model <- adam(y, model="AAN", nIterations=5)model = ADAM(model="AAN", n_iterations=5)
model.fit(y)Higher values may improve initial state estimates but increase computation time.
- Initialisation - State initialisation methods
- Loss-Functions - Loss functions for estimation
- Bounds - Parameter bounds and stability
- ADAM - Main ADAM function documentation
- ES - Exponential Smoothing documentation