Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python alpha和beta大于1的指数平滑_Python_Statsmodels_Smoothing - Fatal编程技术网

Python alpha和beta大于1的指数平滑

Python alpha和beta大于1的指数平滑,python,statsmodels,smoothing,Python,Statsmodels,Smoothing,我有下面的时间序列 year value 2001-01-01 433.0 2002-01-01 445.0 2003-01-01 406.0 2004-01-01 416.0 2005-01-01 432.0 2006-01-01 458.0 2007-01-01 418.0 2008-01-01 392.0 2009-01-01 464.0 2010-01-01 434.0 2012-01-01 435.0 2013-01-01 437.0 2014-0

我有下面的时间序列

year        value
2001-01-01  433.0
2002-01-01  445.0
2003-01-01  406.0
2004-01-01  416.0
2005-01-01  432.0
2006-01-01  458.0
2007-01-01  418.0
2008-01-01  392.0
2009-01-01  464.0
2010-01-01  434.0
2012-01-01  435.0
2013-01-01  437.0
2014-01-01  465.0
2015-01-01  442.0
2016-01-01  456.0
2017-01-01  448.0
2018-01-01  433.0
2019-01-01  399.0
我想用指数平滑模型来拟合。我用以下方式定义我的模型:

model = ExponentialSmoothing(dataframe, missing='drop', trend='mul', seasonal_periods=5,
                              seasonal='add',initialization_method="heuristic")
model = model.fit(optimized=True, method="basinhopping")
其中,我让算法来优化
平滑度水平
=$\alpha$,
平滑度趋势
=$\beta$,
平滑度水平
=$\gamma$和
阻尼度趋势
=$\phi$

但是,当我打印这个特定案例的结果时,我得到:$\alpha=1.49$,$\beta=1.41$,$\gamma=0.0$和$\phi=0.0$

有人能解释一下这里发生了什么事吗?
$\alpha$和$\beta$的这些值大于1是否可以接受?

我认为您误解了结果。我们可以按如下方式运行您的模型:

data = [
    433.0, 445.0, 406.0, 416.0, 432.0, 458.0,
    418.0, 392.0, 464.0, 434.0, 435.0, 437.0,
    465.0, 442.0, 456.0, 448.0, 433.0, 399.0]

model = sm.tsa.ExponentialSmoothing(data, missing='drop', trend='mul', seasonal_periods=5,
                              seasonal='add',initialization_method="heuristic")
res = model.fit(optimized=True, method="basinhopping")

print(res.params['smoothing_level'])
print(res.params['smoothing_trend'])
这给了我:

1.4901161193847656e-08
1.4873988732462211e-08

请注意
e-08
部分-第一个参数不等于1.49,它等于0.0000000 149。

谢谢!我太傻了。我正在使用str(model.params['smoothing_level'])[:4]打印前4个字符的最佳拟合参数,当然,这给了我前4个字符,而不是实数。没问题!我同意,有时Python中的数字字符串打印可能有点挑剔。