I'm building a SARIMAX model.
model = statsmodels.tsa.statespace.sarimax.SARIMAX(endog=y, order=[1,0,1], seasonal_order=[1, 1, 0, 10])
I wanted some parameters to be 0, since the p-value is greater than 0.05 I used fix_params()
{
https://www.statsmodels.org/devel/generated/statsmodels.tsa.statespace.sarimax.SARIMAX.fix_params.html#statsmodels.tsa.statespace.sarimax.SARIMAX.fix_params
}
model.fix_params({'ma.L1': 0}).sumary()
and this is the result I got.
'SARIMAX' object has no attribute 'fix_params'
You need to call
fit
with the parameters fixed. This is done usingfix_params
as a context manager. First the unconstrained model.The estimates are pretty close to the parameters used to generate the sample.
Next, we use the
fix_params
with thewith
keyword to temporarily fix parameters and then callfit
inside the context manager.These parameters differ since there is no MA.
Note that the restriction you are using reduces the model to an MA(0), so it would be better to respecify the model with a
0
in the MA lag length.These parameters match the estimates with the fixed parameter.