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 people alive at age x. Of them die before x+1, so the probability of dying within a year is and of surviving t years . The table can be given as the or as the 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 , the classroom example.
The curtate expectation of life, the whole years still to be lived, is . If deaths are spread evenly through each year, the complete expectation is .
Annuities and insurances
With , a life annuity-due pays 1 at the start of each year while the person is alive,
and whole life insurance pays 1 at the end of the year of death,
Term versions stop after n years, and deferred ones start after u. A pure endowment 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 , 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): . 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 times the benefit.
| call | returns |
|---|---|
| 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 |
@ratmath/finance and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.