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.
本练习是课程的一部分
Life Insurance Products Valuation in R
练习说明
- Define
kpxfor a 40-year-old female. - Create
discount_factorswhich discount payments at time zero (age 40) up to timelength(kpx) - 1at rate 3%. - Assign the pension payments to
benefits. Make sure this vector has the same length askpx. - Compute the
single_premiumas the sum of elementwise product ofbenefits,discount_factorsandkpx. Print out the result.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Survival probabilities of (40)
kpx <- c(___, ___(px[(___):___]))
# Discount factors (to age 40)
discount_factors <- (1 + ___) ^ -(0:(___))
# Pension benefits
benefits <- c(rep(___, ___), rep(___, length(kpx) - 25))
# The single premium
single_premium <- ___
single_premium