Given an output from optim with a hessian matrix, how to calculate parameter confidence intervals using the hessian matrix?
fit<-optim(..., hessian=T)
hessian<-fit$hessian
I am mostly interested in the context of maximum likelihood analysis, but am curious to know if the method can be expanded beyond.
Best Answer
If you are maximising a likelihood then the covariance matrix of the estimates is (asymptotically) the inverse of the negative of the Hessian. The standard errors are the square roots of the diagonal elements of the covariance (from elsewhere on the web!, from Prof. Thomas Lumley and Spencer Graves, Eng.).
For a 95% confidence interval
Note that:
See this for further limitations due to optimization routine used.