CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.32k stars 551 forks source link

expose r_precision parameter in Newton raphson solvers, correct typos #1534

Closed mathurinm closed 1 year ago

mathurinm commented 1 year ago

The stopping criterion of the Newton-Raphson method is mostly controlled by the parameter precision, but there is also a stopping criterion based on the relative improvement of the log-likelihood that so far used a hardcoded value of 1e-9. This PR exposes this parameter in the two NR solvers, with default value 1e-9 so as not to break existing code.

It also harmonizes stopping criteria between time varying and non time varying Cox Fitter

Finally it corrects the spelling of Raphson in docstrings, warning messages and comments

ping @Badr-Moufad

mathurinm commented 1 year ago

The Python 3.9 failure also happens on master and does not seem related to this PR. See failure log on master: https://github.com/CamDavidsonPilon/lifelines/actions/runs/5211690337/jobs/9404297825#step:5:1093

CamDavidsonPilon commented 1 year ago

👍 lgtm - thanks!