时间序列ARIMA预测使用Python

2024-09-30 08:34:04 发布

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

我试图预测原油价格,我把日期作为观察指标,而不是日期时间

model=SARIMAX(df_crudeoil,order=(3,1,3))
cruderesult= model.fit()
print(result.summary())
crude_forecast=cruderesult.get_forecast(steps=30)
mean_crude=crude_forecast.predicted_mean
print(mean_crude)

结果

9229    54.452931
9230    54.476802
9231    54.503399
9232    54.502871
9233    54.463245
9234    54.477102
9235    54.499619
9236    54.498198
9237    54.470114
9238    54.478136
9239    54.496355
9240    54.494998
9241    54.474783
9242    54.479367
9243    54.493714
9244    54.492724

我需要帮助查看索引或将索引转换为日期时间,而不是观察值,这样看起来应该像

2020-01-02   54.452931
2020-01-03   54.476802
2020-01-04   54.503399

Tags: dfmodel时间orderresultmean指标fit

热门问题