Solved – How to estimate 95% confidence intervals using profiling for parameters estimated by maximising a log-likelihood function using optim in R

confidence intervalmaximum likelihoodoptimizationprofile-likelihoodr

How can I estimate 95% confidence intervals using profiling for parameters estimated by maximising a log-likelihood function using optim in R?

I know I can asymptotically estimate the covariance matrix by inverting the hessian, but I am concerned that my data do not meet the assumptions required for this method to be valid. I'd prefer to estimate confidence intervals using some other method.

Is the profile likelihood method appropriate, as discussed in Stryhn and Christensen, and in Venables and Ripley's MASS book, ยง8.4, pp. 220-221?

If so, are there any packages that can help me do this in R? If not, what would the pseudo code for such a method look like?

Best Answer

The mle function from the stats4 package is a wrapper of optim, which makes it quite easy to produce profile likelihood computations. See help("profile,mle-method", package = "stats4") for more information.