Session Ready
Exercise

A retirement plan for Miss Cathleen

As a final assignment during her summer internship Cynthia is asked to do some calculations for Miss Cathleen. Miss Cathleen is a teacher, aged 40, who is planning for retirement. She wants to buy an annuity that provides her 18,000 EUR annually for life, beginning at age 65. Nothing is paid in case of death before 65. The figure below depicts the retirement plan for Miss Cathleen.

The one-year survival probabilities px are again preloaded.

Instructions
100 XP
  • Define kpx for a 40-year-old female.
  • Create discount_factors which discount payments at time zero (age 40) up to time length(kpx) - 1 at rate 3%.
  • Assign the pension payments to benefits. Make sure this vector has the same length as kpx.
  • Compute the single_premium as the sum of elementwise product of benefits, discount_factors and kpx. Print out the result.