Survival Models#
The future lifetime of an individual is represented as a random variable. Under this framework, probabilities of death or survival, as well as an important quantity known as the force of mortality, can be calculated. It is shown how these quantitites are related, along with some actuarial notation.
Lifetime distribution#
Let \((x)\) denotes a life aged x, where \(x \ge 0\), and \(T_x\) is time-to-death, or future lifetime, of \((x)\). This means that \(x + T_x\) represents the age-at-death random variable for \((x)\).
\(F_{x}(t) = Pr[T_x \le t] = \int_0^t f_x(t) ds\)
probability that \((x)\) does not survive beyond age \(x+t\).
Lifetime density function
\(f_x(t) =~ \frac{\partial}{\partial t} F_x(t) =~ \dfrac{f_0(x+t)}{S_0(x)}\)
probability density function for the random variable \(T_x\)
Survival function#
In life insurance problems we may be interested in the probability of survival rather than death
\(S_x(t) \equiv ~_tp_x = Pr[T_x > t] = 1 - F_x(t)\)
the probability that (x) survives for at least t years
\(S_x(t) = \dfrac{S_0(x+t)}{S_0(x)}\)
by assumption that \(Pr[T_x \le t] = Pr[T_0 \le x + t | T_0 > x]\)
\(S_x(t) = \int_t^{\infty} f_x(s) ds\)
since \(\int_0^{t} f_x(s)) ds + \int_t^{\infty} f_x(s) ds = 1\)
\(S_x(t) = \dfrac{l_{x+t}}{l_x}\)
a life table provides a concrete way to visualize the survival function: from a certain number of lives at a starting age, we apply survival probabilities to compute the expected number of lives at any other age.
\(S_x(0) = 1,~ S_x(\infty) = 0, ~S'_x(t) \le 0\)
conditions on \(S_x\) to be a valid survival function
Percentiles:
A \(100p\)-th percentile of survival time is the time \(t\) such that there is a probability \(p\) that survival time ie less than \(t\).
Force of mortality#
What actuaries call the force of mortality, denoted \(\mu_x\), is known as the hazard rate in survival analysis and the failure rate in reliability theory.
\(\mu_{x+t} = \dfrac{f_x(t)}{S_x(t)} = \dfrac{-\frac{\partial}{\partial t} l_{x+t}}{l_{x+t}} = \dfrac{-\frac{\partial}{\partial t} _tp_x}{_tp_x} = \dfrac{\partial}{\partial t} \ln~ _tp_x\)
the force of mortality actually completely determines the survival function
\(f_x(t) =~ _tp_x ~\mu_{x+t}\)
can be related to the lifetime density function for \((x)\)
\(S_x(t) = e^{-\int_x^{x+t} \mu_{s} ds} = e^{-\int_0^t \mu_{x+s} ds}\)
the survival probability, conditional on survival to the age represented by the lower bound, can be computed by integrating the force of mortality up to the age represented by the upper bound.
\(\mu_{x} dx \approx Pr[T_0 \le x + dx | T_0 > x]\)
intuitively, multiplying the force of mortality by a small number \(dx\) can be interpreted as the probability that \((x)\) dies before attaining age \(x + dx\)
\(\int_0^{\infty} \mu_{x+s} ds = \infty\)
since \(S_x(\infty) = 0\)
Actuarial notation#
The actuarial profession uses shorthand notation to record mathematical formulas:
Survival probability
\(~_tp_x = Pr[T_x > t] \equiv S_x(t)\)
probability that \((x)\) survives to at least age \(x+t\)
Expected number of survivors
\(l_{x} = l_{x_0} ~ _{x - x_{0}}p_{x_0}\)
is the expected number of surviving lives at age \(x\) from \(l_{x_0}\) independent individuals aged \(x_0\).
Mortality rate
\(~_tq_x = 1 - ~_tp_x \equiv F_x(t)\)
probability that \((x)\) dies before age \(x+t\).
Deferred mortality rate
\(_{u|t} q_x = Pr[u < T_x \le u + t] = \int_u^{u+t} ~ _sp_x\mu_{x+s} ds \)
probability that \((x)\) survives \(u\) years, and then dies within the subsequent \(t\) years.
\(_{u|t} q_x =~ \dfrac{l_{x+u} - l_{x+u+t}}{l_x}\)
can be related to the number of lives in the life table: total number of deaths of ages between \(x+u\) and \(x+u+t\), divided by number of lives aged \(x\)
\(_{u|t} q_x =~ _up_x {t}q_{x+u} =~ _{u+t}q_x -~ _uq_x =~ _up_x -~ _{u+t}p_x\)
there are three useful formulas for computing deferred mortality: (1) deferred mortality (2) limited mortality, or (3) limited survival probabilities.
Methods#
The Survival class implements methods to compute and apply relationships between the various equivalent forms of survival and mortality functions. The force of mortality function fully describes the lifetime distribution, just as the survival function does.
import math
from actuarialmath import Survival
import describe
describe.methods(Survival)
class Survival - Set and derive basic survival and mortality functions
Methods:
--------
set_survival(S, f, l, mu, minage, maxage):
Construct the basic survival and mortality functions given any one form
l_x(x, s):
Number of lives at integer age [x]+s: l_[x]+s
d_x(x, s):
Number of deaths at integer age [x]+s: d_[x]+s
p_x(x, s, t):
Probability that [x]+s lives another t years: : t_p_[x]+s
q_x(x, s, t, u):
Probability that [x]+s lives for u, but not t+u years: u|t_q_[x]+s
f_x(x, s, t):
Lifetime density function of [x]+s after t years: f_[x]+s(t)
mu_x(x, s, t):
Force of mortality of [x] at s+t years: mu_[x](s+t)
Examples#
The set_survival class method is called to specify any survival model by either its survival probability (with the argument S), force of mortality (mu), number of lives (l), or lifetime density (f) functions. Then the various survival and mortality probabilities and function values can be retrieved using methods with names similar to their respective actuarial notations: p_x, q_x, f_x, mu_x, d_x, l_x. In later sections, special mortality laws like the uniform and exponential distributions, along with their available shortcut formulas, will be described and implemented.
# specify survival function by linearly declining number of lives
life = Survival().set_survival(l=lambda x,s: 100-(x+s), minage=0, maxage=100).set_interest(i=0.05)
print(life.l_x(x=0), life.l_x(x=100), life.l_x(x=50), life.d_x(x=0), life.d_x(x=50))
for x in [10, 50, 90]:
print(life.p_x(x=x), life.q_x(x=x, u=10, t=10), life.f_x(x=x), life.mu_x(x=x))
100 0 50 1 1
0.9888888888888889 0.11111111111111105 1.0 0.011111111111111112
0.98 0.20000000000000007 1.0 0.02
0.9 1.0 1.0 0.1
SOA Question 2.3:
You are given that mortality follows Gompertz Law with B = 0.00027 and c = 1.1. Calculate \(f_{50}(10)\).
print("SOA Question 2.3: (A) 0.0483")
B, c = 0.00027, 1.1
def S(x,s,t): return (math.exp(-B * c**(x+s) * (c**t - 1)/math.log(c)))
life = Survival().set_survival(S=S)
print(life.f_x(x=50, t=10))
SOA Question 2.3: (A) 0.0483
0.048327399045049846
SOA Question 2.6
You are given the survival function:
\(S_0(x) = \left( 1 − \frac{x}{60} \right)^{\frac{1}{3}}, \quad 0 \le x \le 60\)
Calculate \(1000 \mu_{35}\).
print("# SOA Question 2.6: (C) 13.3")
life = Survival().set_survival(l=lambda x,s: (1 - (x+s) / 60)**(1 / 3))
print(1000*life.mu_x(35))
# SOA Question 2.6: (C) 13.3
13.337287043994648
SOA Question 2.7
You are given the following survival function of a newborn:
Calculate the probability that (30) dies within the next 20 years
print("SOA Question 2.7: (B) 0.1477")
def S(x,s):
return 1 - ((x+s) / 250) if (x+s) < 40 else 1 - ((x+s) / 100)**2
print(Survival().set_survival(l=S).q_x(30, t=20))
SOA Question 2.7: (B) 0.1477
0.1477272727272727
SOA Question 2.8
In a population initially consisting of 75% females and 25% males, you are given:
For a female, the force of mortality is constant and equals \(\mu\)
For a male, the force of mortality is constant and equals \(1.5 \mu\)
At the end of 20 years, the population is expected to consist of 85% females and 15% males.
Calculate the probability that a female survives one year.
print("SOA Question 2.8: (C) 0.938")
def fun(mu): # Solve first for mu, given ratio of start and end proportions
male = Survival().set_survival(mu=lambda x,s: 1.5 * mu)
female = Survival().set_survival(mu=lambda x,s: mu)
return (75 * female.p_x(0, t=20)) / (25 * male.p_x(0, t=20))
mu = Survival.solve(fun, target=85/15, grid=0.5)
p = Survival().set_survival(mu=lambda x,s: mu).p_x(0, t=1)
print(p)
SOA Question 2.8: (C) 0.938
0.9383813306903799
CAS41-F99:12
You are given the following survival function:
\(S(x) = 100 (k - \frac{x}{2})^{\frac{2}{3}}\)
Find \(k\), given that \(\mu_{50} = \frac{1}{48}\)
print("CAS41-F99:12: k = 41")
def fun(k):
return Survival().set_survival(l=lambda x,s: 100*(k - (x+s)/2)**(2/3))\
.mu_x(50)
print(Survival.solve(fun, target=1/48, grid=50))
CAS41-F99:12: k = 41
41.00115767959991