Get square root of diagonal of inverse matrix, second method
hess_sd2(m)
A numeric vector of length \(n\).
A square numeric matrix, \(n \times n\).
Caroline Ring
Following the procedure outlined in Gill & King (2004): Calculate generalized inverse of a matrix `m` using [MASS::ginv()]. Then perform a generalized Cholesky factorization of the generalized inverse using [Matrix::Cholesky()] with `perm = TRUE`. Reconstruct the generalized inverse as
$$\left(m^{-1} + E\right) = P_1^{\prime} L L^{\prime} P_1$$
This should ensure positive semi-definiteness of the reconstruction.
Then, take the diagonal of \(\left(m^{-1} + E \right)\), and take the square root.
Gill J, King G. (2004) What to Do When Your Hessian is Not Invertible: Alternatives to Model Respecification in Nonlinear Estimation. Sociological Methods & Research 33(1):54-87. DOI: 10.1177/0049124103262681