I faced the following issue after running ARIMA model:
JavaScript
x
26
26
1
model_final=ARIMA(data_set_final["Price_DX"], order = (ar_order,0,ma_order), exog = data_set_exog)
2
3
SARIMAX Results
4
==============================================================================
5
Dep. Variable: Price_DX No. Observations: 42
6
Model: ARIMA(1, 0, 0) Log Likelihood -156.392
7
Date: Mon, 26 Jul 2021 AIC 322.784
8
Time: 20:48:33 BIC 331.472
9
Sample: 07-01-2010 HQIC 325.968
10
- 10-01-2020
11
Covariance Type: opg
12
==================================================================================
13
coef std err z P>|z| [0.025 0.975]
14
----------------------------------------------------------------------------------
15
const -101.4037 57.505 -1.763 0.078 -214.112 11.304
16
Price_DX1 0.1354 0.053 2.554 0.011 0.032 0.239
17
Europe_DX1 1.1445 0.647 1.768 0.077 -0.124 2.413
18
ar.L1 0.4449 0.164 2.718 0.007 0.124 0.766
19
sigma2 99.8929 26.295 3.799 0.000 48.356 151.430
20
===================================================================================
21
Ljung-B`enter code here`ox (L1) (Q): 0.60 Jarque-Bera (JB): 0.02
22
Prob(Q): 0.44 Prob(JB): 0.99
23
Heteroskedasticity (H): 0.68 Skew: -0.04
24
Prob(H) (two-sided): 0.49 Kurtosis: 3.06
25
===================================================================================
26
How do I extract Prob(Q) and Prob(H) values from ARIMA Summary Table?
For example, I can easily obtain AIC by typing:
JavaScript
1
2
1
print(model_final_fit.aic)
2
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.
JavaScript
1
7
1
test = pd.read_html(model_final.summary().tables[2].as_html(),header=None,index_col=0)[0]
2
# Prob(Q)
3
print(test[1].iloc[1])
4
5
#Prob(H)
6
print(test[1].iloc[3])
7