statsmodels.tsa.holtwinters.SimpleExpSmoothing.fit

SimpleExpSmoothing.fit(smoothing_level=None, *, optimized=True, start_params=None, initial_level=None, use_brute=True, use_boxcox=None, remove_bias=False, method=None, minimize_kwargs=None)[source]

Fit the model

Parameters:
smoothing_levelfloat, optional

The smoothing_level value of the simple exponential smoothing, if the value is set then this value will be used as the value.

optimizedbool, optional

Estimate model parameters by maximizing the log-likelihood.

start_paramsndarray, optional

Starting values to used when optimizing the fit. If not provided, starting values are determined using a combination of grid search and reasonable values based on the initial values of the data.

initial_levelfloat, optional

Value to use when initializing the fitted level.

use_brutebool, optional

Search for good starting values using a brute force (grid) optimizer. If False, a naive set of starting values is used.

use_boxcox{True, False, ‘log’, float}, optional

Should the Box-Cox transform be applied to the data first? If ‘log’ then apply the log. If float then use the value as lambda.

remove_biasbool, optional

Remove bias from forecast values and fitted values by enforcing that the average residual is equal to zero.

methodstr, default “L-BFGS-B”

The minimizer used. Valid options are “L-BFGS-B” (default), “TNC”, “SLSQP”, “Powell”, “trust-constr”, “basinhopping” (also “bh”) and “least_squares” (also “ls”). basinhopping tries multiple starting values in an attempt to find a global minimizer in non-convex problems, and so is slower than the others.

minimize_kwargsdict[str, Any]

A dictionary of keyword arguments passed to SciPy’s minimize function if method is one of “L-BFGS-B” (default), “TNC”, “SLSQP”, “Powell”, or “trust-constr”, or SciPy’s basinhopping or least_squares. The valid keywords are optimizer specific. Consult SciPy’s documentation for the full set of options.

Returns:
HoltWintersResults

See statsmodels.tsa.holtwinters.HoltWintersResults.

Notes

This is a full implementation of the simple exponential smoothing as per [1].

References

[1] Hyndman, Rob J., and George Athanasopoulos. Forecasting: principles

and practice. OTexts, 2014.


Last update: Dec 16, 2024