Life

The Life module contains the class that computes annuity factors for all individuals in the simulation, using mortality tables by province, gender as provided by Statistics Canada.

class CPR.life.life.table(prov='qc', scenario='M', gender='males', web=False)

Class computing annuity factors by province, gender, age and birth year.

Parameters
  • prov (str) – province; default=qc

  • scenario (str) – longevity scenario; default=M (Medium mortality)

  • gender (str) – gender; default=males

  • web (bool) – True to pull data from internet (option unavailable at the moment), False otherwise; default=False

pull_history(prov='qc', gender='males')

Function to get historical mortalilty tables by province and gender.

Parameters
  • prov (str) – province; default=qc

  • gender (str) – gender; default=males

splice()

Function to add survival probabilities for the 2012 birth year and after.

compute_annuity_factor(byear, agestart, rate)

Function to compute an annuity factor.

Parameters
  • byear (int) – birth year

  • agestart (int) – age at which annuity starts

  • rate (float) – interest rate

Returns

Annuity factor.

Return type

float