Skip to content

A small bug in GenericLikelihoodModelResults.bootstrap() #1434

Closed

Description

@herrlich10

I guess line 1917 of statsmodels / base / model.py
rvsind = np.random.randint(self.nobs - 1, size=self.nobs)
should be
rvsind = np.random.randint(self.nobs, size=self.nobs).

Otherwise the last observation would never be sampled.

Activity

  1. josef-pkt commented on Feb 27, 2014

    @josef-pkt
    Member

    Thanks for catching this. clearly a bug

    ( the bootstrap is experimental, because we need to add a more general method for it, that allows a choice of bootstrap type.)

  2. herrlich10 commented on Mar 5, 2014

    @herrlich10
    Author

    statsmodels is a very usefully package, filling the gap between python and statistics beyond high school. (rpy2 and R might be a bit too esoteric to average user like me...) I hope it will become more full-fledged.

    I used GenericLikelihoodModel to fit psychometric function (essentially a modified logistic regression with lower and upper asymptotes other than 0 and 1), and implemented parametric and non-parametric bootstrap methods accordingly. But I found it not easy for me to make the code more generic in order to be useful to others.

  3. herrlich10 commented on Mar 5, 2014

    @herrlich10
    Author

    BTW, shall I close this issue for now?

  4. josef-pkt commented on Mar 6, 2014

    @josef-pkt
    Member

    @herrlich10 No, don't close this issue, I still need to fix this.

    About your application: If you are willing to publish it, it would still make a good example, either to be converted to a notebook documentation example, https://github.com/statsmodels/statsmodels/wiki/Examples , or as an example that can eventually be converted to a supported model class.
    To the latter: I think it would be useful to get a collection of common non-linear models, and logistic regression, without the 0, 1 probability assumption as in discrete Logit, would be a good candidate. IIRC there are at least a few stackoverflow examples for this.

  5. added this to the 0.6 milestone on Jul 16, 2014
  6. added a commit that references this issue on Sep 22, 2014
    4d56aa0
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