CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.34k stars 554 forks source link

Consider if fitters for well-known distributions should use scipy.stats impl #732

Open KOLANICH opened 5 years ago

KOLANICH commented 5 years ago

For example there is scipy.stats.exponweib for Weibull distribution, and it has some methods specially for survival analysis.

CamDavidsonPilon commented 5 years ago

It's an interesting idea, but for parametric models, I require the model also be implemented in the scipy directory in the Autograd package. Many popular ones are (exponweib is absent), and we do use those internally, ex: https://github.com/CamDavidsonPilon/lifelines/blob/master/lifelines/fitters/log_normal_fitter.py#L82

KOLANICH commented 5 years ago

It seems that for fitting exponweib autograd is not needed: it is survival times that are distributed this way, so ... exponweib.fit may be enough. Of course lifelines does a bit more, but I wonder if it is possible to reduce the problem to exponweib.fit. I am also not sure that that uses any info about gradients for fitting, autograd fitting may be more efficient.