I am estimating a survival model with MLE. I use optim to maximize the likelihood function, and I intend to use the Hessian matrix returned by optim to get the standard errors (which lie on the diagonal of the inverse of Hessian). As it turns out that the Hessian matrix is singular and can not be inverted by R's default inverse function base::solve(). I can invert my Hessian using generalized inverse function MASS::ginv() though. What concerns me is that I got many very small standard errors, which render my coefficients suspiciously significant.

What do you think of using ginv() instead of solve() to invert Hessian for inference?

  • $\begingroup$ Which model are you fitting using optim? Does optim converge? $\endgroup$ Commented Oct 18, 2018 at 13:21
  • $\begingroup$ It's a split survival model. Optim did converge. $\endgroup$
    – BellmanEqn
    Commented Oct 18, 2018 at 13:23
  • $\begingroup$ Did you try to use likelihood profiling? to get confidence intervals for the specific parameter(s) that you are interested in? $\endgroup$ Commented May 31, 2019 at 15:08
  • $\begingroup$ What are the eigenvalues of the Hessian? $\endgroup$ Commented Sep 13, 2022 at 16:27

1 Answer 1


solve() fails when the likelihood profile for one or more parameters is flat around the maximum likelihood. It means that the standard error for this or these parameters is infinite. ginv() can be seen as a trick (the Moore-Penrose generalized inverse of a matrix) assuming that standard error is 0 for this or these parameters. It is clearly wrong. If this (or these) parameters are not of interest for you, this can be a good solution. But do not interpret these se ! The solution could be to use Bayesian MCMC rather.

  • 1
    $\begingroup$ the problem is that it may be a linear combination of parameters which is ill-identified, rather than a particular one, which would mess with the SE of all involved parameters. $\endgroup$ Commented Sep 13, 2022 at 16:32
  • $\begingroup$ Good point ! I didn't thought about this solution. Have you a solution to identify the set of parameters involved in this potential collinearity? $\endgroup$
    – MarcG
    Commented Sep 13, 2022 at 20:35
  • 1
    $\begingroup$ You can easily identify the singular linear combinations by looking at the eigenvectors of the Hessian for near-zero eigenvalues, but you'll only get good inference for combinations orthogonal to these (and I'm not sure what's rigorously known about Wald tests for partially singular problems like this) $\endgroup$ Commented 21 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.