添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am performing a time series analysis using statsmodels and the exponential smoothing method. I am trying to reproduce the results from

https://www.statsmodels.org/devel/examples/notebooks/generated/exponential_smoothing.html

with a particular dataframe (with the same format as the example, but only one outcome). Here are the lines of code:

from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
fit = ExponentialSmoothing(dataframe, seasonal_periods=4, trend='add', seasonal='mul', initialization_method="estimated").fit()
simulations = fit.simulate(5, repetitions=100, error='mul')
fit.fittedvalues.plot(ax=ax, style='--', color='green')
simulations.plot(ax=ax, style='-', alpha=0.05, color='grey', legend=False)
fit.forecast(8).rename('Holt-Winters (add-mul-seasonal)').plot(ax=ax, style='--', marker='o', color='green', legend=True)

However, when I run it, I get the error

TypeError: __init__() got an unexpected keyword argument 'initialization_method'

but when I check the parameters of ExponentialSmoothing in statsmodel, initialization_method is one of them, so I don't know what happens there.

Moving forward, I removed initialization_method from the parameters of ExponentialSmoothing within the code, then I get another error the line below

AttributeError: 'ExponentialSmoothing' object has no attribute 'simulate'

Again, I go and check if simulate is not deprecated in the latest version of statsmodels and no, it is still an attribute.

I upgraded the statsmodels, I upgraded pip and I still get the same errors.

What is it going on there?

Thanks in advance for any help!

I had the same problem. I upgraded to 0.12.0 and the problem went away. However, I have had some instabiity problems with it as the parameters have changed. Now having problems with TypeError: smoothing_level must be float_like (float or np.inexact) or None – leeprevost Oct 12, 2020 at 1:11

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.