Multiplication rules!
Cynthia is fascinated by the multiplication rule applicable to survival probabilities. She wants to verify her earlier calculated probabilities using this rule. But let's start slowly. What is the probability that she (an 18-year-old) will be alive when she is supposed to graduate from her \(3 + 2\) year bachelor and master program?
Next, you will calculate \(_kp_x\) for \(x\) an 18-year-old female and \(k=1,2,3, \ldots\) What is the probability for an 18-year-old to reach the magic number of 100?
The column qx
extracted from life_table
has been preloaded. The one-year survival probabilities px
have been defined as one minus the mortality rates qx
.
This exercise is part of the course
Life Insurance Products Valuation in R
Exercise instructions
- Compute the probability of an 18-year-old to turn 23 using
prod()
(docs). - Define
kpx
as the multi-year survival probabilities of an 18-year-old until the age of 100 usingcumprod()
. - Print the probability of an 18-year-old to reach the magic number of 100.
- Visualize the multi-year survival probabilities by plotting
kpx
against a vector from 1 until thelength()
ofkpx
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Calculate the probability that (18) survives 5 more years
___(px[(___):(___)])
# Compute the survival probabilities of (18) until the age of 100
kpx <- ___(px[(___):(___)])
# Extract the probability that (18) survives until the age of 100
___
# Plot the probabilties for (18) to reach the age of 19, 20, ..., 100
plot(___, ___,
pch = 20,
xlab = "k",
ylab = expression(paste(""[k], "p"[18])),
main = "Survival probabilities for (18)")