# Don't fear the integral!

Actuaries denote with $${}_tp_x$$ the probability that a life alive aged exactly $$x$$ years will survive a further $$t$$ years or more.  The most basic result in survival analysis is the following relationship with the instantaneous mortality hazard, $$\mu_x$$:

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

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

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

It is at this point that cortisol levels spike for some people, often because it is a long time since they last saw an integral.  In the case of actuaries, this can lead them to seek safety in the comfort of standard tables based on $$q_x$$.  However, even if you have forgotten everything you ever knew about integration, equation (2) poses no hurdle for mortality work.  The reason is that $$H_x(t)$$ is just a function, and Richards (2008, Table 5) has a list of explicit formulae for the seven most common mortality models used by actuaries.  For example, assume that you want to integrate the Gompertz mortality hazard $$\mu_x=\exp(\alpha+\beta x)$$.  Table 5 of Richards (2008) has this formula to use:

$H_x(t) = \frac{(e^{\beta t}-1)}{\beta}e^{\alpha+\beta x}\qquad(3).$

Thus, the integrated hazard between age 60 and 80 with $$\alpha=-12$$ and $$\beta=0.12$$ is 0.6874017.  No integration is required because it has already been done.  For the more adventurous, Richards (2012, Table 2) lists formulae for $$H_x(t)$$ for a further ten models.

But what if you have an unusual mortality model that isn't listed?  Then $$H_x(t)$$ can be approximated numerically using R's $$\tt integrate$$ function.  The following snippet of R code illustrates this using the same Gompertz model as an example:

dAlpha = -12.0
dBeta = 0.12
GompertzHazard = function(x)
{
return(exp(dAlpha+dBeta*x))
}
integrate(GompertzHazard, 60, 80)

If you paste the above into an R console you will see output like this:

0.6874017 with absolute error < 7.6e-15

which is the same result using the closed-form expression in equation (3).  Use $$\tt help(integrate)$$ within your R console to find out how to fine-tune your control over this function.  And if your IT department won't let you use R, then there are some surprisingly accurate approximations available for integration; see also Appendix D of Macdonald et al (2018).

So, with explicit formulae freely available for most mortality models - and accurate approximations for all others - you can use survival models without ever having to work out a single integral yourself.  Unless you really want to, that is.

References:

Macdonald, A. S., Richards, S. J. and Currie, I. D. (2018) Modelling Mortality with Actuarial Applications, Cambridge University Press, ISBN 978-1-107-04541, doi 10.1017/9781107051386.

Richards, S. J. (2008) Applying survival models to pensioner mortality data, British Actuarial Journal, 14(2), pages 257-303, doi 10.1017/S1357321700001720.

Richards, S. J. (2012). A handbook of parametric survival models for actuarial use, Scandinavian Actuarial Journal, 2012(4), pages 233–257, doi 10.1080/03461238.2010.506688.

Written by: Stephen Richards
Publication Date:
Last Updated: