Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A small bug in GenericLikelihoodModelResults.bootstrap() #1434

Closed
herrlich10 opened this issue Feb 27, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@herrlich10
Copy link

commented Feb 27, 2014

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.

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Feb 27, 2014

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.)

@herrlich10

This comment has been minimized.

Copy link
Author

commented Mar 5, 2014

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.

@herrlich10

This comment has been minimized.

Copy link
Author

commented Mar 5, 2014

BTW, shall I close this issue for now?

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Mar 6, 2014

@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.

@josef-pkt josef-pkt added this to the 0.6 milestone Jul 16, 2014

@josef-pkt josef-pkt referenced this issue Sep 22, 2014

Closed

release 0.6 #912

11 of 25 tasks complete

@josef-pkt josef-pkt closed this in 4d56aa0 Sep 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.