Topic

Life contingencies

Life insurance and pensions value money that is paid only if someone is alive, or only when they die. With a life table of whole numbers and a rational interest rate, every present value is a fraction, and the identities that connect them hold exactly.

const L = lifeTable({ l: [100000, 99500, 98900, …], startAge: 60 });   // or { q: [...] }, or deMoivre(100)
L.p(60, 10);                                            // probability a 60-year-old reaches 70
lifeAnnuity(L, { age: 65, rate: "4%" });                // ä: 1 a year from now while alive
lifeInsurance(L, { age: 40, rate: "4%", term: 20 });    // A: 1 at the end of the year of death, within 20 years
netPremium(L, { kind: "endowment", benefit: 100000, age: 40, rate: "4%", term: 20 });
reserve(L, { kind: "endowment", benefit: 100000, age: 40, rate: "4%", term: 20, time: 10 });

The life table

A life table follows a group of lxl_x people alive at age x. Of them dx=lx−lx+1d_x = l_x - l_{x+1} die before x+1, so the probability of dying within a year is qx=dx/lxq_x = d_x/l_x and of surviving t years tpx=lx+t/lx{}_tp_x = l_{x+t}/l_x. The table can be given as the lxl_x or as the qxq_x from a radix. It closes at the last age: everyone alive there dies within the year. No published table is built in; you supply the numbers. deMoivre(ω) gives the straight-line table lx=ω−xl_x = \omega - x, the classroom example.

The curtate expectation of life, the whole years still to be lived, is ex=∑k≥1kpxe_x = \sum_{k\ge1} {}_kp_x. If deaths are spread evenly through each year, the complete expectation is ex+12e_x + \tfrac12.

Annuities and insurances

With v=1/(1+i)v = 1/(1+i), a life annuity-due pays 1 at the start of each year while the person is alive,

a¨x=∑k≥0vk kpx,\ddot a_x = \sum_{k\ge0} v^k\,{}_kp_x,

and whole life insurance pays 1 at the end of the year of death,

Ax=∑k≥0vk+1 kpx qx+k.A_x = \sum_{k\ge0} v^{k+1}\,{}_kp_x\,q_{x+k}.

Term versions stop after n years, and deferred ones start after u. A pure endowment nEx=vn npx{}_nE_x = v^n\,{}_np_x pays 1 at n if the person is alive, and an endowment insurance is term insurance plus that.

Paying 1 at the end of the year of death is the same as paying d = i/(1+i) at the start of each year while alive, plus 1 at death. So Ax=1−d a¨xA_x = 1 - d\,\ddot a_x, and the same holds for an endowment with the n-year annuity. Because everything here is exact, the tests check this identity with equals, not with a tolerance.

Premiums and reserves

A level net premium P paid while alive must have the same present value as the benefit (the equivalence principle): P a¨=benefit⋅AP\,\ddot a = \text{benefit}\cdot A. After t years the reserve is what the insurer must hold. It is the value then of the benefit still to come, less the value of the premiums still to come. It is zero at the start by construction, and for an endowment it reaches the benefit at the end of the term. For whole life it equals 1−a¨x+t/a¨x1 - \ddot a_{x+t}/\ddot a_x times the benefit.

callreturns
lifeTable({ l } or { q, radix }, startAge), deMoivre(ω)LifeTable: l, d, p, q, deferredQ, curtateExpectation, completeExpectation, rows()
lifeAnnuity(table, { age, rate, term, due, deferred })exact
lifeInsurance(table, { age, rate, term, deferred })exact
pureEndowment, endowment(table, { age, rate, term })exact
netPremium(table, { kind, benefit, age, rate, term, payments })exact
reserve(table, { …, time })exact
Try itEdit the code and run it with @ratmath/finance and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs