pmdarima将对象分配给自动\u arima输出

2024-04-28 15:21:27 发布

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

我正在使用auto_arima进行实验,它提供了最佳模型的良好输出,可用于时间序列预测

from pmdarima import auto_arima

stepwise_fit = auto_arima(hourly_avg['kW'], start_p=0, start_q=0,
                          max_p=2, max_q=2, m=4,
                          seasonal=False,
                          d=None, trace=True,
                          error_action='ignore',   # we don't want to know if an order does not work
                          suppress_warnings=True,  # we don't want convergence warnings
                          stepwise=True)           # set to stepwise

stepwise_fit.summary()

输出:

Performing stepwise search to minimize aic
 ARIMA(0,0,0)(0,0,0)[0]             : AIC=778.328, Time=0.01 sec
 ARIMA(1,0,0)(0,0,0)[0]             : AIC=inf, Time=0.07 sec
 ARIMA(0,0,1)(0,0,0)[0]             : AIC=inf, Time=0.07 sec
 ARIMA(1,0,1)(0,0,0)[0]             : AIC=138.016, Time=0.12 sec
 ARIMA(2,0,1)(0,0,0)[0]             : AIC=135.913, Time=0.16 sec
 ARIMA(2,0,0)(0,0,0)[0]             : AIC=inf, Time=0.11 sec
 ARIMA(2,0,2)(0,0,0)[0]             : AIC=135.302, Time=0.27 sec
 ARIMA(1,0,2)(0,0,0)[0]             : AIC=138.299, Time=0.14 sec
 ARIMA(2,0,2)(0,0,0)[0] intercept   : AIC=121.020, Time=0.36 sec
 ARIMA(1,0,2)(0,0,0)[0] intercept   : AIC=123.032, Time=0.36 sec
 ARIMA(2,0,1)(0,0,0)[0] intercept   : AIC=119.824, Time=0.28 sec
 ARIMA(1,0,1)(0,0,0)[0] intercept   : AIC=125.968, Time=0.31 sec
 ARIMA(2,0,0)(0,0,0)[0] intercept   : AIC=118.512, Time=0.15 sec
 ARIMA(1,0,0)(0,0,0)[0] intercept   : AIC=130.956, Time=0.12 sec

Best model:  ARIMA(2,0,0)(0,0,0)[0] intercept
Total fit time: 2.547 seconds

这里没有太多的智慧,对此我深表歉意,但有可能为最佳拟合模型分配一个变量吗?还是必须从上面的输出中手动选择ARIMA(2,0,0)才能继续使用时间序列预测方法

例如,一些变量,如best_model = Best model: ARIMA(2,0,0)最好的选择是什么


Tags: to模型trueautomodeltime时间aic