【发布时间】:2020-08-01 13:52:41
【问题描述】:
我正在使用以下代码在statsmodels 中获得简单的指数平滑。
years = [1979,1980,1981,1982,1983,1984,1985,1986,1987,1988]
mylist = [3.508046180009842, 64.08556070923805, 15.407086104154587, 0, 3.8572598099708557, 11.009202659130096, 5.324577212333679, 4.33474725484848, 4.024865210056305, 5.065838277339935]
import pandas as pd
from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing
myinput = pd.Series(mylist, years)
fit_model = SimpleExpSmoothing(myinput).fit()
smoothed = fit_model.fittedvalues
print(smoothed.tolist())
我得到的结果非常令人惊讶。即我每年都得到相同的值。
[11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004, 11.661719028226004]
我想知道为什么我每年都得到相同的值。请告诉我如何解决这个问题?
如果需要,我很乐意提供更多详细信息。
【问题讨论】:
标签: python time-series signal-processing statsmodels smoothing