Appendix: Life Expectancy

Life expectancy is computed from a projected life table using the following standard actuarial definitions. It is used during calibration to evaluate how well a candidate \(\beta_{\text{sex}}\) reproduces Statistics Canada’s targets.

We first define some variables:

Variable

Type

Definition

\(x\)

float

age in years

\(\Delta x\)

float

the width of the age interval in years

\(\ell(x, \Delta x, t)\)

int

the number of people alive up to age \(x\) at timepoint \(t\)

\(q(x, \Delta x, t)\)

float

the probability of death between ages \([x, x + \Delta x)\) at timepoint \(t\)

\(d(x, \Delta x, t)\)

int

the number of deaths between ages \([x, x + \Delta x)\) at timepoint \(t\)

\(a(x, \Delta x, t)\)

float

the average fraction of the interval \([x, x + \Delta x)\) lived by those who die in the interval, for a given timepoint \(t\) and \(\Delta x\)

\(L(x, \Delta x)\)

int

the area under the survival curve between ages \([x, x + \Delta x)\)

\(T(x, t)\)

int

the total number of person-years lived after age \(x\)

\(E(x, t)\)

float

the number of years left to live at age \(x\)

\(E(x=0, t)\)

float

the number of years left to live at age \(0\) for someone born at timepoint \(t\), i.e. life expectancy

Number of People Alive

First, we set the number of people alive at age \(0\) at timepoint \(t\):

\[\ell(x=0, \Delta x, t) := 100000\]

Next, we calculate the number of people alive up to age \(x\):

\[\textcolor{magenta}{\underbrace{\ell(x, \Delta x, t)}_{\text{no. alive at age } x}} = \textcolor{orange}{\underbrace{\ell(x-\Delta x, \Delta x, t)}_{\text{no. alive at age } (x - \Delta x)}} - \textcolor{green}{\underbrace{\ell(x-\Delta x, \Delta x, t) \cdot q(x-\Delta x, \Delta x, t)}_{\text{no. died between ages } [x - \Delta x, x)}}\]

Total Deaths

The number of deaths \(d(x, \Delta x, t)\) between ages \([x, x + \Delta x)\), is given by the number of people alive at age \(x\) multiplied by the probability of death between ages \([x, x + \Delta x)\):

\[\textcolor{magenta}{\underbrace{d(x, \Delta x, t)}_{\text{no. died between ages } [x, x + \Delta x)}} = \textcolor{orange}{\underbrace{\ell(x, \Delta x, t)}_{\text{no. alive at age } x}} \cdot \textcolor{green}{\underbrace{q(x, \Delta x, t)}_{\text{prob. of death between ages } [x, x + \Delta x)}}\]

Survival Curve

Formally, the area under the survival curve between ages \([x, x + \Delta x)\) is given by:

\[L(x, \Delta x, t) = \int_{x}^{x + \Delta x} \ell(\chi, \Delta \chi, t) d\chi\]

However, we can approximate this using the midpoint formula for numerical integration:

\[L(x, \Delta x, t) \approx \ell(x + \Delta x, \Delta x, t) \cdot \Delta x + a(x, \Delta x, t) \cdot d(x, \Delta x, t) \cdot \Delta x\]

We can simplify the above equation to:

\[\begin{align} L(x, \Delta x, t) &= (\ell(x, \Delta x, t) - (1 - a(x, \Delta x, t)) \cdot d(x, \Delta x, t))\Delta x \end{align}\]
Math: \(L(x, \Delta x, t)\)
\[\begin{split}\begin{align} L(x, \Delta x, t) &= (\ell(x + \Delta x, \Delta x, t) + a(x, \Delta x, t) \cdot d(x, \Delta x, t)) \Delta x \\ &= (\ell(x, \Delta x, t) \cdot (1 - q(x, \Delta x, t)) + a(x, \Delta x, t) \cdot d(x, \Delta x, t))\Delta x \\ &= (\ell(x, \Delta x, t) - \textcolor{magenta}{\ell(x, \Delta x, t) \cdot q(x, \Delta x, t)} + a(x, \Delta x, t) \cdot d(x, \Delta x, t))\Delta x \\ &= (\ell(x, \Delta x, t) - \textcolor{magenta}{d(x, \Delta x, t)} + a(x, \Delta x, t) \cdot d(x, \Delta x, t)) \Delta x \\ &= (\ell(x, \Delta x, t) - (1 - a(x, \Delta x, t)) \cdot d(x, \Delta x, t))\Delta x \end{align}\end{split}\]

Assuming that deaths are uniform across the interval \([x, x + \Delta x)\), we have \(a(x) = 0.5\) for all \(x\). Thus, we have:

\[\begin{align} L(x, \Delta x, t) = (\ell(x, \Delta x, t) - 0.5 d(x, \Delta x, t))\Delta x \end{align}\]

Because infant mortality is highest in the first few days of life, if \(\Delta x < 7 \text{days}\), we set \(a(x_0) = 0.1\).

For the final age group, since everyone dies, \(l(x_f + \Delta x, \Delta x, t) = 0\), and \(q(x_f, \Delta x, t) = 1\). Thus, we have:

\[\begin{split}\begin{align} L(x_f, \Delta x, t) &= (\ell(x_f + \Delta x, \Delta x, t) + a(x_f, \Delta x , t) \cdot d(x_f, \Delta x, t)) \Delta x \\ &= (0 + a(x_f, \Delta x, t) \cdot d(x_f, \Delta x, t)) \Delta x \\ &= a(x_f, \Delta x, t) \cdot d(x_f, \Delta x, t) \cdot \Delta x \\ &= a(x_f, \Delta x, t) \cdot \ell(x_f, \Delta x, t) \cdot q(x_f, \Delta x, t) \cdot \Delta x \\ &= a(x_f, \Delta x, t) \cdot \ell(x_f, \Delta x, t) \cdot \Delta x \end{align}\end{split}\]

Time Lived After Age \(x\)

\(T(x, t)\): calculate the total time lived after age \(x\) by all people alive at age \(x\)

\[T(x, t) = \sum_{n = 0}^{N} L(x + n \cdot \Delta x, \Delta x, t)\]

where \(x + N \cdot \Delta x = 110\) is the maximum age in the life table, and \(t\) represents the current timepoint.

Number of Years Left to Live

The number of years left to live at age \(x\) is given by \(E(x, t)\):

\[E(x, t) = \dfrac{T(x, t)}{\ell(x, t)}\]

Finally, to get the life expectancy, we calculate the number of years left to live at age 0, i.e. \(E(0, t)\):

\[\text{life expectancy} := E(0, t) = \dfrac{T(0, t)}{\ell(0, t)}\]