Hi Chad
Thanks so much your comment and tip, the link you sent has been super helpful. However you said that in order for me to implement this it would have to be a subclass of SARIMAX, not MLEModel as indicated in the example. I have tried to make a class like this:
However, I have gotten this error:

Not sure if I should brush up my knowledge on Stats and Python Class/Subclasses (or both) but how can I go forward in creating a subclass of SARIMAX where I can choose the bounds of the exogenous variables inputted to create the model?
Thanks,
Ani
Hi Ani,
Yes, you'll want to create a subclass of SARIMAX, which will mean that you don't have to implement most of those methods, since they will be handled by the SARIMAX base class. I think a minimal example of what you're after would be something like:
class SARIMAXCoeffBounds(SARIMAX):
def __init__(self, endog, bounds=None, *args, **kwargs):
# Setup the basic model
super().__init_(endog, *args, **kwargs)
# Handle the bounds argument in whatever way you want to
...
def transform_params(self, unconstrained):
# Perform the transformations required for the base SARIMAX model
constrained = super().transform_params(unconstrained)
# Now modify the appropriate elements of the `constrained` array in
# order to transform the regression coefficients to satisfy the bounds
...
return constrained
def untransform_params(self, constrained):
# Perform the reverse transformations required for the base SARIMAX
# model
unconstrained = super().untransform_params(constrained)
# Now modify the appropriate elements of the `unconstrained` array in
# order to reverse the transformation on the regression coefficients
...
return unconstrained
We use a transformation to bound one of the parameters in the `UnobservedComponents` model, and you can look there for one way to do that (right after the comment "Cycle frequency must be between between our bounds").
Best,
Chad