Skip to content
Advertisement

Extract Summary Values from ARIMA

I faced the following issue after running ARIMA model:

model_final=ARIMA(data_set_final["Price_DX"], order = (ar_order,0,ma_order), exog = data_set_exog)

    SARIMAX Results
==============================================================================
Dep. Variable:           Price_DX   No. Observations:                   42
Model:                 ARIMA(1, 0, 0)   Log Likelihood                -156.392
Date:                Mon, 26 Jul 2021   AIC                            322.784
Time:                        20:48:33   BIC                            331.472
Sample:                    07-01-2010   HQIC                           325.968
                         - 10-01-2020
Covariance Type:                  opg
==================================================================================
                     coef    std err          z      P>|z|      [0.025      0.975]
----------------------------------------------------------------------------------
const           -101.4037     57.505     -1.763      0.078    -214.112      11.304
Price_DX1     0.1354      0.053      2.554      0.011       0.032       0.239
Europe_DX1      1.1445      0.647      1.768      0.077      -0.124       2.413
ar.L1              0.4449      0.164      2.718      0.007       0.124       0.766
sigma2            99.8929     26.295      3.799      0.000      48.356     151.430
===================================================================================
Ljung-B`enter code here`ox (L1) (Q):                   0.60   Jarque-Bera (JB):                 0.02
Prob(Q):                              0.44   Prob(JB):                         0.99
Heteroskedasticity (H):               0.68   Skew:                            -0.04
Prob(H) (two-sided):                  0.49   Kurtosis:                         3.06
===================================================================================

How do I extract Prob(Q) and Prob(H) values from ARIMA Summary Table?

For example, I can easily obtain AIC by typing:

print(model_final_fit.aic)

Unfortunately, I could not find properties for Ljung-Box and Heteroskedasticity here. Do you know how to get them easily?

Advertisement

Answer

The summary method stores these outputs as html tables. You can extract these values by converting to pandas dataframe.

test = pd.read_html(model_final.summary().tables[2].as_html(),header=None,index_col=0)[0]
# Prob(Q) 
print(test[1].iloc[1])

#Prob(H)
print(test[1].iloc[3])
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement