在具有趋势和季节性的指数平滑中,
from statsmodels.tsa.holtwinters import ExponentialSmoothing
model = ExponentialSmoothing(ts, trend = 'add', seasonal = 'add', seasonal_periods = seasonal_periods).fit(use_boxcox = False )
model.fittedvalues [1]应该等于model.level [0] + model.slope [0] + model.season [0]
我尝试调试代码,并获得以下时间序列数据结果
[中间结果]
l b s fittedvalues
7.825891 0.092598 4.184139 12.1026285
6.830679 0.092598 25.566966 32.49024301
44.539827 0.092598 75.694492 120.3269171
33.817185 0.092598 49.497633 83.40741656
36.030335 0.092598 299.227998 335.3509305
[最终结果]
level slope season fittedvalues
6.830679 0.092598 4.184139 12.1026285
44.539827 0.092598 25.566966 32.49024301
33.817185 0.092598 75.694492 120.3269171
36.030335 0.092598 49.497633 83.40741656
21.170956 0.092598 299.227998 335.3509305
为什么更改跟随值后拟合值不改变
level = l[1:nobs + 1].copy()
slope = b[1:nobs + 1].copy()
season = s[m:nobs + m].copy()
如果我错了,请纠正我,