Ad

Exponential Smoothing In Statsmodels Gives Error

- 1 answer

I am trying to apply Holt-winter exponencial smoothing and in stastsmodels there is still a error

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'
Ad

Answer

Have you tried to cast your data like this :

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