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.
Diese Übung ist Teil des Kurses
Life Insurance Products Valuation in R
Anleitung zur Übung
- Based on the
life_annuity_due()function, write a new functionlife_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, bothkpxanddiscount_factorsshould 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.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# 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(___, ___, ___)