1

Running

from statsmodels.tsa.statespace.sarimax import SARIMAX

model = SARIMAX([1,2,3,4,5,6,7,8,9,10], order=(0,0,1)).fit(disp=False) print(model.summary()) print(model.predict())

yields

                               SARIMAX Results                                
==============================================================================
Dep. Variable:                      y   No. Observations:                   10
Model:               SARIMAX(0, 0, 1)   Log Likelihood                 -27.378
Date:                Thu, 10 Aug 2023   AIC                             58.756
Time:                        18:44:11   BIC                             59.361
Sample:                             0   HQIC                            58.092
                                 - 10                                         
Covariance Type:                  opg                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
ma.L1          0.9996    495.167      0.002      0.998    -969.509     971.508
sigma2        11.0045   5454.459      0.002      0.998   -1.07e+04    1.07e+04
===================================================================================
Ljung-Box (L1) (Q):                   6.51   Jarque-Bera (JB):                 0.62
Prob(Q):                              0.01   Prob(JB):                         0.73
Heteroskedasticity (H):              13.60   Skew:                            -0.01
Prob(H) (two-sided):                  0.06   Kurtosis:                         1.78
===================================================================================

and the prediction

[0.         0.49999996 0.99999988 1.49999978 1.99999964 2.49999948
 2.99999929 3.49999907 3.99999881 4.49999853]

The moving average coefficient is ~1, so that's good. But what is going on with the prediction? Why does it start at 0 and then go up by ~0.5 each step? Mechanically, what is statsmodels doing here?

I'd appreciate it if someone could show a "by-hand" calculation of how to think about the MA process in this scenario, like here: How does statsmodels calculate in-sample predictions in AR models?

I'm aware the time-series that I provided is not stationary, and I'm aware of this question: How Statsmodels predict ma process

0 Answers0