简体   繁体   中英

Differencing terms not showing in statsmodels SARIMAX summary

Statsmodels contains the SARIMAX for seasonal timeseries analysis. When trying to implement the method, I am confused about the lack of differencing/integrating terms showing up in the summary. This is for instance visible in the example in the documentation itself . Where would I find the coefficient corresponding to the d -parameter? I can only see the AR-coefficient and the MA-coefficient.

Below an example of what I mean. I was expecting something where I added the ???

                                       SARIMAX Results                                       
=============================================================================================
Dep. Variable:                                 Value   No. Observations:                 1680
Model:             SARIMAX(2, 2, 2)x(1, 1, [1], 168)   Log Likelihood                3705.949
Date:                               Tue, 15 Dec 2020   AIC                          -7397.898
Time:                                       17:08:28   BIC                          -7361.500
Sample:                                            0   HQIC                         -7384.261
                                              - 1680                                         
Covariance Type:                                 opg                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
ar.L1         -0.6993      0.609     -1.149      0.251      -1.893       0.494
ar.L2          0.0913      0.058      1.570      0.116      -0.023       0.205
in.L1 = ???
in.L2 = ???
ma.L1         -0.1994      0.685     -0.291      0.771      -1.542       1.144
ma.L2         -0.8003      0.654     -1.224      0.221      -2.081       0.481
ar.S.L168     -0.1656      0.029     -5.779      0.000      -0.222      -0.109
in.S.L168 = ???
ma.S.L168     -0.6969      0.031    -22.498      0.000      -0.758      -0.636
sigma2         0.0002   6.32e-05      3.298      0.001    8.45e-05       0.000
===================================================================================
Ljung-Box (L1) (Q):                   0.05   Jarque-Bera (JB):                23.49
Prob(Q):                              0.82   Prob(JB):                         0.00
Heteroskedasticity (H):               0.87   Skew:                             0.09
Prob(H) (two-sided):                  0.13   Kurtosis:                         3.63
===================================================================================

Warnings:
[1] Covariance matrix calculated using the outer product of gradients (complex-step).
Backend GTK3Agg is interactive backend. Turning interactive mode on.

These are part of the model, which can be accessed using res.model , and then either order or seasonal_order .

import statsmodels.tsa.api as tsa
import numpy as np

gen = np.random.default_rng()

mod = tsa.SARIMAX(gen.standard_normal(1000),order=(2,1,1),seasonal_order=(1,1,1,12))
res = mod.fit()

print(res.model.order)
print(res.model.seasonal_order)

print(f"The differencing order (d) is {res.model.order[1]}")
print(f"The seasonal differencing order (D) is {res.model.seasonal_order[1]}")
print(f"The seasonal period {res.model.seasonal_order[-1]}")

which outputs

The differencing order (d) is 1
The seasonal differencing order (D) is 1
The seasonal period 12

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM