【问题标题】:Exponential smoothing in statsmodels gives errorstatsmodels 中的指数平滑会产生错误
【发布时间】:2020-01-09 23:36:59
【问题描述】:

我正在尝试应用 Holt-winter 指数平滑,但在 stastsmodels 中仍然存在错误

data = Airpassengers
from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
data["exp"] = ExponentialSmoothing(data["Passengers"], seasonal="mul", seasonal_periods=12).fit()
ValueError: Buffer dtype mismatch, expected 'double' but got 'long long'

【问题讨论】:

    标签: python time-series statsmodels


    【解决方案1】:

    您是否尝试过像这样投射数据:

    data["exp"] = ExponentialSmoothing(data["Passengers"].astype(np.int64), seasonal="mul", seasonal_periods=12).fit()
    

    【讨论】:

      猜你喜欢
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-04
      • 2019-02-26
      • 2020-08-01
      • 2014-03-22
      • 2019-04-03
      • 1970-01-01
      相关资源
      最近更新 更多