R code for constructing likelihood based confidence intervals for the mean residual life

The following R-code may be used for computing likelihood based confidence intervals for the mean (or expected) residual life.

Definition of the mean residual life
The mean residual life (or expected remaining lifetime) of a unit at time t is given by:

MRL(t) = \frac{\int^{\infty}_{t} (u-t)f(u)\ du}{S(t)} = \frac{\int^{\infty}_{t} S(u) \ du}{S(t)}

where MRL(t) is the mean residual life at time t, f(·) the probability density function of the failure times, and S(·) the survival function. Continue reading R code for constructing likelihood based confidence intervals for the mean residual life