Open tomwenseleers opened 6 years ago
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 ...
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
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 :-) ?
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?