Get startedGet started for free

Immediate vs due

As a follow-up assignment Cynthia's supervisor asks her to figure out how to adjust the script for an immediate life annuity in which the payments start after one year.

The Belgian 1999 female life table is preloaded as life_table and the solution code from the previous exercise is given as a starting point. Type life_annuity_due to the console if you want to recall the function definition.

This exercise is part of the course

Life Insurance Products Valuation in R

View Course

Exercise instructions

  • Based on the life_annuity_due() function, write a new function life_immediate_annuity() which computes the EPV of a whole life immediate annuity. Since there is no benefit paid at time 0 for an immediate annuity, both kpx and discount_factors should be defined from time 1.
  • Compute the EPV of a whole life immediate annuity for (20) at a constant interest rate of 2% using life_table. Verify that the result is 1 EUR lower than for the annuity due.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# EPV of a whole life annuity due for (20) at interest rate 2% using life_table
life_annuity_due(20, 0.02, life_table)

# Function to compute the EPV of a whole life immediate annuity for a given age, interest rate i and life table
life_immediate_annuity <- function(age, i, life_table) {
  px <- ___
  kpx <- ___(px[(age + 1):length(px)])
  discount_factors <- (___) ^ - (___)
  sum(___)
}

# EPV of a whole life immediate annuity for (20) at interest rate 2% using life_table
life_immediate_annuity(___, ___, ___)
Edit and Run Code