Skip to content

BUG: GMM summary has incorrect param_names #4340

Closed

Description

@josef-pkt

AFAICS, GMM does not have param_names and uses exog_names in summary() which does not have the correct length. summary table is truncated at the length of provided names

https://stackoverflow.com/questions/49272902/i-have-a-probable-with-using-statsmodels-sandbox-regression-gmm-gmm/49279673?s=1|0.0000#49279673

work around: Change the exog_names to have the correct length, e.g.

res.model.exog_names[:] = 'p0 p1 p2 p3'.split()
print(res.summary())

Activity

  1. added this to the 0.9 milestone on Mar 14, 2018
  2. josef-pkt commented on Mar 30, 2018

    @josef-pkt
    MemberAuthor

    GMM doesn't seem to have unit tests for this case (xnames to short)

    adding assert_equal(len(summ.tables[1]), len(res1.params) + 1) to test_gmm_poisson.CheckGMM doesn't fail, i.e. correct number or params in summary params_table

    test_gmm.py has smoke tests for summary in some classes, but not in CheckGMM

    _fix_param_names(self, params, param_names=None) does not correctly handle the case where len(xnames) < len(params), AFAICS
    maybe we can use some pattern from GenericLikelihoodResults, which I fixed later than the code here, .IIRC

    Needs another example as a test case, e.g. gamma or the one above, for which I have examples in notebooks.

  3. josef-pkt commented on Apr 5, 2018

    @josef-pkt
    MemberAuthor

    according to test coverage, the incorrect if else branch is not used
    https://coveralls.io/builds/16330861/source?filename=statsmodels%2Fsandbox%2Fregression%2Fgmm.py#L532

    I will replace the xnames in this case by generic names.

  4. added a commit that references this issue on Apr 5, 2018
    52465a6
  5. josef-pkt commented on Apr 5, 2018

    @josef-pkt
    MemberAuthor

    ok, just found a duplicate, that I already opened a few years ago
    #1465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions