CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.38k stars 560 forks source link

AFT model extrapolation. #1413

Open daniyalshahzad opened 2 years ago

daniyalshahzad commented 2 years ago

Given that I have a parametric model, with a defined distribution (lognormal). How can I extrapolate the survival curves so that I can predict lifetimes without getting an inf?

CamDavidsonPilon commented 2 years ago

Hi @daniyalshahzad, I assuming you're getting an inf with predict_median (judging by the SO question you posted).

This is unexpected, as we internally compute the median explicitly. Does your code look something like the following?

l = LogNormalAFTFitter()
l.fit(rossi, "week", "arrest")
l.predict_median(rossi)

And you see inf in the last output? Do your coefficients look sensible? l.print_summary()