## Some points for integration

The survivor function from age $$x$$ to age $$x+t$$, denoted $${}_tp_x$$ by actuaries, is a useful tool in mortality work.Ā As mentioned in one of our earliest blogs, a basic feature is that the expected time lived is the area under the survival curve, i.e. the integral of $${}_tp_x$$.Ā This is easy to express in visual terms, but it often requires numerical integration if there is no closed-form expression for the integral of the survival curve.Ā In this article we look at some of the options available to actuaries who need to integrate numerically.

A general result is that the survivor function has the following form:

${}_tp_x = e^{-H_x(t)}$

where $$H_x(t)$$ is the integrated hazard function:

$H_x(t) = \int_0^t \mu_{x+s}ds$

and $$\mu_x$$ is the force of mortality at age $$x$$.Ā Richards (2014) tabulates closed-form expressions for $$\mu_x$$ and $$H_x(t)$$ for a wide variety of mortality models.Ā However, to calculate the expected time lived over an age interval $$[x, u)$$, we need to perform a second integral:

$\int_0^{u-x} {}_tp_x dt$

If we let $$u\to\infty$$ then we would get the complete life expectancy from age $$x$$. Now, how could we go about approximating this integral between the ages of 65 and 100 (say)? One approach is simple brute force: we approximate the survivor function by a series of steps of width $$h$$ and sum the area of the rectangles.Ā Mathematically this would be:

$\int_0^{u-x}{}_tp_x \approx h\sum_{i=1}^{nh} {}_tp_x\qquad(1)$

where we have split the domain of integration into $$n$$ equally sized intervals of width $$h$$.Ā If we can evaluate $${}_tp_x$$ for any value of $$t$$, we can select an arbitrarily small value of $$h$$ to get an approximation of the integral using equation (1).Ā This is illustrated in Table 1 for the Gompertz law of mortality using various values of $$h$$.

Table 1. Expected time lived between ages 65 and 100 under Gompertz law of mortality, $$\mu_x=e^{\alpha+\beta x}$$, with $$\alpha=-12$$ and $$\beta=0.12$$.

hExpected time lived
1 15.83259
0.1 15.38153
0.01 15.33650
0.001 Ā15.33200
0.0001 Ā15.33155

Ā

The brute-force approach in Table 1 looks like it is converging to 15.33.Ā However, this is at the cost of a fair amount of computing resource: for $$h=0.0001$$ the survival function has had to be computed 350,000 times.Ā A smarter approach is to use something like adaptive quadrature, which requires far fewer evaluations of the survival function.Ā R offers this in the $$\tt integrate()$$ function for single-variable calculations: for our Gompertz example this function returns the value 15.3315 with an absolute error less than 8.1e-8.

The brute-force and adaptive-quadrature methods both rely on being able to calculate $${}_tp_x$$ at arbitrary points.Ā However, in actuarial work it is common to have to calculate a life expectancyĀŚ or an annuity factorĀŚ where $${}_tp_x$$ is only available for integer values of $$t$$.Ā How can we accurately integrate under a curve where the values of the curve are only available at fixed points?Ā One approach is to use some results from the history of mathematics:

For two points separated by one year we use the Trapezoidal Rule:

$\int_a^{a+1} f(x) \approx \frac{1}{2}\left[f(a)+f(a+1)\right]$

For three points spaced one year apart we use Simpson's Rule:

$\int_a^{a+2} f(x) \approx \frac{1}{3}\left[f(a) + 4f\left(a+1\right) + f(a+2)\right]$

For four points spaced one year apart we use Simpson's 3/8 Rule:

$\int_a^{a+3} f(x) \approx \frac{3}{8}\left[f(a) + 3f(a+1) + 3f(a+2) + f(a+3)\right]$

To integrate over $$n$$ points at yearly intervals we would first apply Simpson's 3/8 Rule as many times as possible, then Simpson's Rule and then the Trapezoidal Rule for any remaining points at the highest ages.Ā How accurate would this simple approach be?Ā If we apply it to our Gompertz example with $${}_tp_{65}$$ evaluated for $$t = 0, 1, 2,\ldots,35$$ we get 15.3315, the same value returned by R's $$\tt integrate()$$ function.Ā This shows that a remarkable degree of accuracy can be obtained just from using values at yearly-spaced intervals.

References

Richards, S. J. (2012) A handbook of parametric survival models for actuarial use, Scandinavian Actuarial Journal, 2012(4), 233¢257. ### RECENT POSTS

This is the fourth and final blog on the use ... Read more
The Institute and Faculty of Actuaries in the UK has ... Read more
The resurgence of measles in Europe signals something of a ... Read more  Stephen Richards is the Managing Director of Longevitas
##### Integration in the Projections Toolkit
Life expectancies and annuity factors are calculated using Simpson's 3/8 Rule, with Simpson's Rule and the Trapezoidal Rule used for any shorter intervals at the highest ages.Ā Users can control the integration method using the configuration parameter Integration under curves.