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

Support confidence and prediction intervals in predict method? #16

Open
tomwenseleers opened this issue Mar 28, 2018 · 3 comments
Open

Comments

@tomwenseleers
Copy link

tomwenseleers commented Mar 28, 2018

For a specific application I would like to be able to calculate confidence and prediction intervals. Would it be hard to incorporate these in the predict method of bbmle?

@bbolker
Copy link
Owner

bbolker commented Mar 28, 2018

hmm. At present AFAICT the predict method (?"predict,mle2-method") doesn't support any kind of intervals (confidence or prediction)? Maybe I'm missing something? Confidence intervals would probably have to be done by delta method or bootstrapping (or much more fancily, by constrained optimization/likelihood profiling). Prediction intervals are kind of hard for non-Gaussian responses; we usually assume multivariate Normal sampling errors of the parameters, and this variation has to be compounded with the variation in the response. For Gaussian responses the combination is Gaussian (we can sum the variance in the prediction and the residual variance, then compute CIs from a Gaussian with predicted mean and var= (predict var + resid var)), but it's harder for non-Gaussian responses ...

@tomwenseleers
Copy link
Author

Ha sorry I see now that confidence intervals were also still on the TO DO list... :-) I was indeed thinking that the delta method could be used for that... For prediction intervals - could parametric bootstrapping not be used for that, analogously to how the ciTools provides prediction intervals for GLMs? :
https://cran.r-project.org/web/packages/ciTools/vignettes/ciTools-glm-vignette.html

@tomwenseleers tomwenseleers changed the title Support both confidence and prediction intervals in predict method? Support confidence and prediction intervals in predict method? Mar 28, 2018
@bbolker
Copy link
Owner

bbolker commented Mar 28, 2018

Yes, something like that would be the way to do it.

I'm in a bit of a quandary over bbmle: it works well enough in its current form, but there are several nice extensions: the current suggestion, and providing analytical gradients (maybe even allowing for a TMB back-end) -- but I'd also like to think about refactoring the code before I started making major/structural improvements.

Know anyone who wants to help :-) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants