Skip to content

Use conditional_after times for predict_expectation of WeibullAFTFitter #1680

Description

@TeyBerendschot

Hi! Since recently I have been using the lifelines package in a professional context. Thanks for sharing this amazing work! We mainly use the package to fit Weibulls and use these fits to make predictions about remaining lifetimes and failure probabilities. Currently it is not possible to incorporate the lifetime of censored subjects when calculating the expected lifetime using the predict_expectation method of the WeibullAFTFitter. This would be a useful feature for us.

The expected remaining lifespan is given by:

$$\mathbb{E}(T-t_0\mid T\geq t_0) = \lambda \exp(H(t_0))\cdot\Gamma(1+1/\rho, H(t_0))-t_0\,,$$

where $\Gamma$ denotes the upper incomplete gamma function. The scipy library provides an implementation for the upper incomplete gamma function.

I would be happy to work on an implementation of such a feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions