statsmodels.tsa.holtwinters.ExponentialSmoothing.fit

method

ExponentialSmoothing.fit(smoothing_level=None, smoothing_slope=None, smoothing_seasonal=None, damping_slope=None, optimized=True, use_boxcox=False, remove_bias=False, use_basinhopping=False, start_params=None, initial_level=None, initial_slope=None, use_brute=True)[source]

Fit the model

Parameters
smoothing_levelfloat, optional

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

smoothing_slopefloat, optional

The beta value of the Holt’s trend method, if the value is set then this value will be used as the value.

smoothing_seasonalfloat, optional

The gamma value of the holt winters seasonal method, if the value is set then this value will be used as the value.

damping_slopefloat, optional

The phi value of the damped method, if the value is set then this value will be used as the value.

optimizedbool, optional

Estimate model parameters by maximizing the log-likelihood

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 lambda equal to float.

remove_biasbool, optional

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

use_basinhoppingbool, optional

Using Basin Hopping optimizer to find optimal values

start_params: array, 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_level: float, optional

Value to use when initializing the fitted level.

initial_slope: float, optional

Value to use when initializing the fitted slope.

use_brute: bool, optional

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

Returns
resultsHoltWintersResults class

See statsmodels.tsa.holtwinters.HoltWintersResults

Notes

This is a full implementation of the holt winters exponential smoothing as per [1]. This includes all the unstable methods as well as the stable methods. The implementation of the library covers the functionality of the R library as much as possible whilst still being Pythonic.

References

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

and practice. OTexts, 2014.