chjackson / flexsurv

The flexsurv R package for flexible parametric survival and multi-state modelling
http://chjackson.github.io/flexsurv/
53 stars 28 forks source link

Hessian control `tol.evalue` ignored #189

Closed stephematician closed 2 months ago

stephematician commented 3 months ago

In 7bce70f the use of an approximate covariance (nearest positive-definite) was intended whenever negative eigenvalues were sufficiently small (in either the Hessian or similarly its inverse); however there is a short-circuit test that discards the hessian prior to the approximation method:

https://github.com/chjackson/flexsurv/blob/e16d5fd5eb419e876b15d0b35a94cf59d2063cc7/R/flexsurvreg.R#L988

This is a tricky case to test, so I'm not surprised that it wasn't picked up when implemented.