You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an example with an extra parameter, additional to exog.shape[1], the extra parameter is not added to the params table in summary().
The default way that model.data.xnames is set, only looks at exog.
In GenericLikelihoodModel, there are additional adjustments to add names so exog_names matches params (same length).
GMM doesn't have anything similar. How do users define parameter names? except explicitely in summary call.
workaround:
mod = RobustGMM(endog, exog, instrument=None)
res = mod.fit(start_params=start_params, inv_weights=np.eye(len(start_params)))
mod.data.xnames.append('scale')
print res.summary()
You can either overwrite exog_names property or assign to self.data.xnames. We're setting it in ARMA, but maybe because it hasn't been called yet? I'm not sure. I thought I explicitly used getter and setter somewhere.
Activity
jseabold commentedon Mar 12, 2014
exog_namesshould be a settable property.https://github.com/statsmodels/statsmodels/blob/master/statsmodels/base/model.py#L119
https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/arima_model.py#L853
Does that do it?
A bit inconsistent
https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/arima_model.py#L931
josef-pkt commentedon Mar 12, 2014
Good, from what I remembered it wasn't settable. Correction: it can be changed but not assigned ?
I still need to find a way where to add the default adjustment. For GenericLikelihoodModel, I put it into the
__init__of the --Results-- Model class.There I used (which I didn't remember):
josef-pkt commentedon Mar 12, 2014
BTW this works, but I don't know if it's not only because I already have the attribute in my example
jseabold commentedon Mar 12, 2014
You can either overwrite exog_names property or assign to self.data.xnames. We're setting it in ARMA, but maybe because it hasn't been called yet? I'm not sure. I thought I explicitly used getter and setter somewhere.
josef-pkt commentedon Apr 5, 2018
GMM case fixed in #4428, includes a set_param_names method in GMM
Aside: both solutions assigning to data.xname and modifying model.exog_names are now used by many models with extra params and by generic models.
#4426 new issue for more general param_names/xnames/exog_names inconsistencies