Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/342.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 Statsmodels ETSModel get_预测遇到错误_Python_Time Series_Statsmodels_Forecasting_Holtwinters - Fatal编程技术网

Python Statsmodels ETSModel get_预测遇到错误

Python Statsmodels ETSModel get_预测遇到错误,python,time-series,statsmodels,forecasting,holtwinters,Python,Time Series,Statsmodels,Forecasting,Holtwinters,我试图通过StatsModels ETSModel从Holt Winters时间序列模型中获得预测间隔。有人能帮我找出哪里出了问题吗 fit1 = ETSModel(x_train, seasonal_periods=7, trend='add', seasonal='mul', damped_trend=True).fit() fcst = fit1.get_prediction(start=current_date, end=current_date + np.timedelta64(6,'

我试图通过StatsModels ETSModel从Holt Winters时间序列模型中获得预测间隔。有人能帮我找出哪里出了问题吗

fit1 = ETSModel(x_train, seasonal_periods=7, trend='add', seasonal='mul', damped_trend=True).fit()
fcst = fit1.get_prediction(start=current_date, end=current_date + np.timedelta64(6,'D'))
我得到以下错误:

File "C:\ProgramData\Anaconda3\lib\site-packages\statsmodels\tsa\exponential_smoothing\ets.py", line 2078, in get_prediction
    **simulate_kwargs,

  File "C:\ProgramData\Anaconda3\lib\site-packages\statsmodels\tsa\exponential_smoothing\ets.py", line 2234, in __init__
    start : (end + 1)

ValueError: could not broadcast input array from shape (0) into shape (7)
这是输入:

x_train
Out[24]: 
ds
2020-08-04    1027.0
2020-08-05    1813.0
2020-08-06    2157.0
2020-08-07    3070.0
2020-08-08    2968.0
2020-08-09    2083.0
2020-08-10    1762.0
2020-08-11    1755.0
2020-08-12    1788.0
2020-08-13    2266.0
2020-08-14    3272.0
2020-08-15    2768.0
2020-08-16    1869.0
2020-08-17    1940.0
2020-08-18    1673.0
2020-08-19    1821.0
2020-08-20    2293.0
2020-08-21    2802.0
2020-08-22    2604.0
2020-08-23    1843.0
2020-08-24    1758.0
2020-08-25    1393.0
2020-08-26    1612.0
2020-08-27    2165.0
2020-08-28    2898.0
2020-08-29    2471.0
2020-08-30    2297.0
Freq: D, dtype: float64

current_date
Out[25]: numpy.datetime64('2020-09-01')

如果开始日期在数据集结束之后,这看起来像是一个带有
get\u prediction
的bug。我建议您在提交错误报告


同时,看起来您需要将
开始
设置为数据集中的最后一个日期(例如,您给出的示例中的2020-08-30),然后手动将结果子集为仅来自
当前日期
转发。

感谢您的回复。我已经提交了一份bug报告。如果开始日期大于数据集7018,则ETSModel get#u预测bug