smooth documentation

Classes

ADAM([model, lags, ar_order, i_order, ...])

ADAM: Augmented Dynamic Adaptive Model for Time Series Forecasting.

ES([model, lags, persistence, phi, initial, ...])

Exponential Smoothing in Single Source of Error (SSOE) state space model.

ADAM Methods

ADAM.fit(y[, X])

Fit the ADAM model to time series data.

ADAM.predict(h[, X, calculate_intervals, ...])

Generate point forecasts using the fitted ADAM model.

ADAM.predict_intervals(h[, X, levels, side])

Generate prediction intervals using the fitted ADAM model.

ADAM.select_best_model()

Select the best model based on information criteria and update model parameters.

ADAM.summary([digits])

Generate a formatted summary of the fitted model.

ES Methods

ES.fit(y[, X])

Fit the ADAM model to time series data.

ES.predict(h[, X, calculate_intervals, ...])

Generate point forecasts using the fitted ADAM model.

ES.predict_intervals(h[, X, levels, side])

Generate prediction intervals using the fitted ADAM model.

ES.select_best_model()

Select the best model based on information criteria and update model parameters.

ES.summary([digits])

Generate a formatted summary of the fitted model.

Utility Functions

  • msdecompose - Multiple seasonal decomposition for time series

  • lowess - LOWESS (Locally Weighted Scatterplot Smoothing)

Optimization Settings

The ADAM and ES classes use the NLopt library for parameter optimization. You can customize the optimization behavior via the nlopt_kargs parameter:

from smooth import ADAM

model = ADAM(
    model="AAN",
    nlopt_kargs={
        "print_level": 1,        # Print optimization progress
        "xtol_rel": 1e-8,        # Relative parameter tolerance
        "algorithm": "NLOPT_LN_SBPLX"  # Use Subplex algorithm
    }
)
model.fit(y)

Available parameters:

Parameter

Description

Default

print_level

Verbosity level. When >0, prints B and CF on every iteration.

0

xtol_rel

Relative tolerance on parameters. Stops when changes < xtol_rel * |params|.

1e-6

xtol_abs

Absolute tolerance on parameters. Stops when changes < xtol_abs.

1e-8

ftol_rel

Relative tolerance on cost function. Stops when changes < ftol_rel * |CF|.

1e-8

ftol_abs

Absolute tolerance on cost function. Stops when changes < ftol_abs.

0

algorithm

NLopt algorithm name. Use “LN_” prefix for derivative-free. Options: NLOPT_LN_NELDERMEAD, NLOPT_LN_SBPLX, NLOPT_LN_COBYLA, NLOPT_LN_BOBYQA.

NLOPT_LN_NELDERMEAD