You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the problem is the res.predict() only returns one observation instead of a nobs array.
Also, AFAIK, assigning attributes does not overwrite inherited cached properties. (IIRC we have that problem in RegressionResults scale)
this means we have to add cached properties explicitly override the inherited method.
e.g. we could use plain property with internally assigned _fittedvalues
Bug/convention: I think predict should follow standard pattern and return full nobs array.
holtwinters Results classes has a forecast method which defaults to a single one step forecast identical to predict.
Also the holtwinters classes still compute post estimation results like sse/ssr, aic in fit instead of in results class results is computed in fit following standard definition, but not used in fit.
running pytest holtwinter.py shows also 5 convergence warnings.
If those are expected, then they should be silenced, otherwise investigated for improvements.
about resid
There are no unit tests, and resid = endog - fittedvalues is not true if fit option remove_bias=True, because the resid.mean() is subtracted in fitted which is fittedvalues concatenated with forecast, but resid attribute is not debiased.
I'm making some small changes in #5255 without the refactoring of moving more post estimation results from fit to results methods.
rename attribute to _fittedvalues and add property fittedvalues
rename resid to resid_biased and let HoltWintersResults.resid be the, new in 5255, cached attribute from base.Results which satisfies resid = endog - fittedvalues
The holtwinters module has been fully rewritten since this review was filed: Results now uses explicit _fittedvalues/_resid-backed properties (no more cached-property masking) and predict() returns a proper array, resolving both original complaints. Closing as superseded by the rewrite. Note: one narrow issue survives - HoltWintersResults.resid still does not equal endog - fittedvalues when fit(remove_bias=True) is used (statsmodels/tsa/holtwinters/model.py computes resid before the debiasing adjustment) - happy to file that as its own focused issue if useful.
Activity
josef-pkt commentedon Sep 25, 2018
the problem is the
res.predict()only returns one observation instead of a nobs array.Also, AFAIK, assigning attributes does not overwrite inherited cached properties. (IIRC we have that problem in RegressionResults scale)
this means we have to add cached properties explicitly override the inherited method.
e.g. we could use plain property with internally assigned
_fittedvaluesBug/convention: I think
predictshould follow standard pattern and return full nobs array.holtwinters Results classes has a
forecastmethod which defaults to a single one step forecast identical to predict.Also the holtwinters classes still compute post estimation results like sse/ssr, aic in fit instead of in results class
resultsis computed infitfollowing standard definition, but not used in fit.josef-pkt commentedon Sep 25, 2018
running pytest holtwinter.py shows also 5 convergence warnings.
If those are expected, then they should be silenced, otherwise investigated for improvements.
about
residThere are no unit tests, and resid = endog - fittedvalues is not true if fit option remove_bias=True, because the resid.mean() is subtracted in
fittedwhich is fittedvalues concatenated with forecast, but resid attribute is not debiased.I'm making some small changes in #5255 without the refactoring of moving more post estimation results from fit to results methods.
_fittedvaluesand add propertyfittedvaluesresidtoresid_biasedand letHoltWintersResults.residbe the, new in 5255, cached attribute from base.Results which satisfiesresid = endog - fittedvaluesbashtage commentedon Jul 30, 2026
The holtwinters module has been fully rewritten since this review was filed: Results now uses explicit _fittedvalues/_resid-backed properties (no more cached-property masking) and predict() returns a proper array, resolving both original complaints. Closing as superseded by the rewrite. Note: one narrow issue survives - HoltWintersResults.resid still does not equal endog - fittedvalues when fit(remove_bias=True) is used (statsmodels/tsa/holtwinters/model.py computes resid before the debiasing adjustment) - happy to file that as its own focused issue if useful.