我正在尝试通过 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')