I'm trying to get the prediction of ma process using model parameters. MA(1) process is: $$X_t = \Theta \omega_{t-1} + \omega_t$$ Hence the prediction might behave like$$X_t = \Theta \omega_{t-1}$$
But it seems that Statsmodels has some "initialization" that affect the head of the prediction.
For example, I create here MA(1) process and print the difference between my prediction using the model parameters and Statsmodels prediction:
y = [1,2,0,1,0.5,1.5,1,1,1.3,2,0.7]
model = sm.tsa.SARIMAX(y,order=(0,0,1)).fit(disp=False)
prediction = model.predict()
residuals = model.resid
params = model.params
print([(params[0]*residuals[i]-prediction[1+i]) for i in range(len(y)-1)])
And in the results you can see the non-zero difference (that became smaller in time).
> [0.057898976628312615,
0.015479432460304365,
-0.0010168740694590506,
0.00032489606054031395,
-6.4951881716558e-07,
1.0618887241187203e-05,
4.5199844286858415e-07,
1.6323989904254432e-07,
3.073650017837437e-08,
8.574563170604677e-09]
Can anyone explain what model Statsmodels is using to get this prediction?
Note that same phenomenon exist also in R, see here.
r[i]
andp[1+i]
in your code? $\endgroup$