预测间隔阿尔玛·普雷迪

2024-05-23 19:37:36 发布

您现在位置:Python中文网/ 问答频道 /正文

时间序列的ARMA预测摘要(print arma_mod.summary())显示了一些关于置信区间的数字。在显示预测值的绘图中,是否可以使用这些数字作为预测间隔?在

ax = indexed_df.ix[:].plot(figsize=(12,8))
ax = predict_price.plot(ax=ax, style='rx', label='Dynamic Prediction');
ax.legend(); 

我猜密码是:

^{pr2}$

在此处找到:Confidence intervals for model prediction

…在这里不适用,因为它是为OLS而不是ARMA预测而设计的。我也检查了github,但没有发现任何可能与时间序列预测有关的新东西。在

(我想做预测需要预测间隔,尤其是在样本外预测时。)

感谢帮助。在


Tags: mod绘图plot时间序列数字summaryax
1条回答
网友
1楼 · 发布于 2024-05-23 19:37:36

我想,对于样本外的ARMA预测,您可以使用ARMA.forecastfromstatsmodels.tsa在

它返回三个数组:预测值、标准误差和预测的置信区间。在

ARMA(1,1)、时间序列y和预测提前1步的示例:

import statsmodels as sm
arma_res = sm.tsa.ARMA(y, order=(1,1)).fit()
preds, stderr, ci = arma_res.forecast(1)

相关问题 更多 >