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
{{ message }}
Repository navigation
BUG/ENH: GMM, allow None exog and instruments in generic GMM #2633
Here we only have a single data variable, e.g. just an endog
fit and summary work if we create fake exog and instruments to provide the shape, but it doesn't work if we set exog and instrument to None.
ENH: provide better default support when we don't have the endog, exog, instrument pattern for the data and model.
problems: how and where do we infer and set k_params and k_moments, and how do we set the param names? (summary/SimpleTable truncate params list if names are not full length)
(edit) param_names handling in GMM looks a bit outdated, needs check with current implementation of generic attributes in model.data. We have now param_names separate from xnames, IIRC.
(edit 2) I'm not sure anymore it's a code or documentation problem (and missing informative ValueErrors). If I set k_moments and k_params correctly, then everything seems to work, even with GMM(y, None, None, ...).
>>> model2 = my_GMM2(X, None, None)
>>> res_c2 = model2.fit(start_params=[2.05831079, 0.06579918], inv_weights=np.eye(4), maxiter=2, optim_method='nm', wargs=dict(centered=True))
Optimization terminated successfully.
Current function value: 0.001803
Iterations: 30
Function evaluations: 60
Optimization terminated successfully.
Current function value: 0.105310
Iterations: 37
Function evaluations: 66
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "m:\josef_new\eclipse_ws\statsmodels\statsmodels_py34\statsmodels\sandbox\regression\gmm.py", line 679, in fit
self._fix_param_names(params, param_names=None)
File "m:\josef_new\eclipse_ws\statsmodels\statsmodels_py34\statsmodels\sandbox\regression\gmm.py", line 531, in _fix_param_names
if len(params) < len(xnames):
TypeError: object of type 'NoneType' has no len()
Activity
josef-pkt commentedon Oct 1, 2015
to replicate Greene's results, requires
josef-pkt commentedon Oct 2, 2015
I ran into this before see https://github.com/statsmodels/statsmodels/pull/2455/files#diff-1b3411f7d5ad604e44f690f8d7790fe0R184
because it was just internal code I quickly worked around it. But it doesn't work for
summary.#2455 is unfinished because I didn't have time and didn't have Stata 14 to test against
josef-pkt commentedon Oct 8, 2015
relevant issue for setting xnames or param_names (maybe outdated) #1465