【问题标题】:pmdarima assign object to auto_arima outputpmdarima 将对象分配给 auto_arima 输出
【发布时间】:2021-01-31 02:14:07
【问题描述】:

我正在尝试使用 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)这样的变量,最好的选择是什么......

【问题讨论】:

    标签: python statistics time-series statsmodels pmdarima


    【解决方案1】:

    Look at the documentation where they give an example:

    model = pm.auto_arima(train, seasonal=False)
    
    # make your forecasts
    forecasts = model.predict(24)  # predict N steps into the future
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-04
      • 2010-11-27
      • 1970-01-01
      • 2020-05-07
      • 1970-01-01
      • 2018-06-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多