Table

class elizur.life.table.LifeTable(table: Union[Iterable, numpy.array], name: str = '', description: str = '', initial_pop: int = 100000)

Given an input tuple of failure probabilities this class is capable of calculating common actuarial functions such as qx, px, lx, dx, ex, mx, w, nqx, npx, nlx, ndx, nmx, tqxn, Dx, Sx, Nx, Cx, Mx, Rx, actuarial present value of annuities, and actuarial present value of insurances.

Parameters
  • table – iterable of failure probabilities as floats in sequential order, e.g. (1q0, 2q1, …, 100q99)

  • initial_pop – the size of the initial population (l0)

dx(x: int) → float:
Args:
  • x - start age

Returns:

The number of failures between ages x and x + 1

qx(x: int) → float:
Args:
  • x - start age

Returns:

The probability of failure between the ages x and x + 1

px(x: int) → float:
Args:
  • x - start age

Returns:

The probability of survival between the ages x and x + 1

lx(x: int) → float:
Args:
  • x - start age

Returns:

The population size at age x. This is the same thing as the number of person years lived between age x and x + 1.

ex(x: int) → float:
Args:
  • x - start age

Returns:

The curtate life expectation at age x

mx(x: int) → float:
Args:
  • x - start age

Returns:

The central failure rate between ages x and x + 1

nqx(n: int, x: int) → float:
Args:
  • n - width of failure interval in years

  • x - start age

Returns:

The probability of failure between ages x and x + n

nqxs(n: int) → np.array:
Args:
  • n - width of failure interval in years

Returns:

The probability of failure between ages x and x + n for all ages

npx(n: int, x: int) → float:
Args:
  • n - width of failure interval in years

  • x - start age

Returns:

The probability of survival between ages x and x + n

npxs(n: int) → np.array:
Args:
  • n - width of failure interval in years

Returns:

The probability of survival between ages x and x + n for all ages

nlx(n: int, x: int) → float:
Args:
  • n - width of failure interval in years

  • x - start age

Returns:

The number of person years lived between ages x and x + n

ndx(n: int, x: int) → float:
Args:
  • n - width of failure interval in years

  • x - start age

Returns:

The number of failures between ages x and x + n

nmx(n: int, x: int) → float:
Args:
  • n - width of failure interval in years

  • x - start age

Returns:

The central failure rate between ages x and x + n

tqxn(t: int, n: int, x: int) → float:
Args:
  • t - width of the failure interval in years

  • n - width of the survival interval in years

  • x - start age

Returns:

The probability of surviving from age x to x + n and then failing between age x + n and age x + n + t

tqxns(t: int, n: int) → np.array:
Args:
  • t - width of the failure interval in years

  • n - width of the survival interval in years

Returns:

The probability of surviving from age x to x + n and then failing between age x + n and age x + n + t for all ages

Dx(x: int, i: float) → float:

Actuarial commutation function Dx

Args:
  • x - start age

  • i - interest rate

Returns:

Population at age x discounted for x years

Nx(x: int, i: float) → float:

Actuarial commutation function Nx

Args:
  • x - start age

  • i - interest rate

Returns:

Sum of Ds from age x and onward

Sx(x: int, i: float) → float:

Actuarial commutation function Sx

Args:
  • x - start age

  • i - interest rate

Returns:

Sum of Ns from age x and onward

Cx(x: int, i: float) → float:

Actuarial commutation function Cx

Args:
  • x - start age

  • i - interest rate

Returns:

Failures between x and x + 1 discounted for x years

Mx(x: int, i: float) → float:

Actuarial commutation function Mx

Args:
  • x - start age

  • i - interest rate

Returns:

Sum of Cs from age x and onward

Rx(x: int, i: float) → float:

Actuarial commutation function Rx

Args:
  • x - start age

  • i - interest rate

Returns:

Sum of Ms from age x and onward

Ax(x: int, i: float) → float:
Args:
  • x - start age

  • i - interest rate

Returns:

Actuarial present value of level whole insurance

Axn(x: int, i: float, n: int) → float:
Args:
  • x - start age

  • i - interest rate

  • n - number of periods in the temporary insurance

Returns:

Actuarial present value of level temporary insurance

IAx(x: int, i: float) → float:
Args:
  • x - start age

  • i - interest rate

Returns:

Actuarial present value of increasing whole insurance

IAxn(x: int, i: float, n: int) → float:
Args:
  • x - start age

  • i - interest rate

  • n - number of periods in the temporary insurance

Returns:

Actuarial present value of increasing temporary insurance

ax(x: int, i: float) → float:
Args:
  • x - start age

  • i - interest rate

Returns:

Actuarial present value of a level perpetuity

axn(x: int, i: float, n: int) → float:
Args:
  • x - start age

  • i - interest rate

  • n - length of payments

Returns:

Actuarial present value of a temporary annuity

ax_due(x: int, i: float) → float:
Args:
  • x - start age

  • i - interest rate

Returns:

Actuarial present value of a level perpetuity due

axn_due(x: int, i: float, n: int) → float:
Args:
  • x - start age

  • i - interest rate

  • n - length of payments

Returns:

Actuarial present value of a temporary annuity due

get_lxs() → Tuple[float]

This method is deprecated and will be removed in v1.0.0

The recommended method is to use the ‘lxs’ property

Returns

A tuple of the population counts (lxs)

get_qxs() → Tuple[float]

This method is deprecated and will be removed in v1.0.0

The recommended method is to use the ‘qxs’ property

Returns

A tuple of the failure probabilities (qxs), e.g., (0q1, 2q1, …, 100q99)

property w

Returns: The limiting age of the life table