Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/315.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 ARMA.predict的预测区间_Python_Time Series_Forecasting_Confidence Interval_Autoregressive Models - Fatal编程技术网

Python ARMA.predict的预测区间

Python ARMA.predict的预测区间,python,time-series,forecasting,confidence-interval,autoregressive-models,Python,Time Series,Forecasting,Confidence Interval,Autoregressive Models,时间序列的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(); 我猜代码是: from statsmodels.sandbox.regres

时间序列的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(); 
我猜代码是:

from statsmodels.sandbox.regression.predstd import wls_prediction_std
prstd, iv_l, iv_u = wls_prediction_std(results)
可在此处找到:

…此处不适用,因为它是为OLS而不是ARMA预测而设计的。我还检查了github,但没有发现任何可能与时间序列预测相关的新内容

(我想,进行预测需要预测间隔,特别是在样本外预测时。)


谢谢你的帮助

我想,对于样本外ARMA预测,可以使用from statsmodels.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)

看起来该方法也适用于ARIMA模型。有人知道如何计算置信区间吗?它只是使用数据的标准偏差吗?
将statsmodels.api导入为sm
,而不是
将statsmodels导入为sm