Deferred mortality probabilities
In this exercise, you will help Cynthia to better understand the concept of a \(k\)-year deferred mortality probability for an 18-year-old. This is the probability that one first survives \(k\) years, reaches age \(18+k\) and then dies in the next year:
$$ \begin{aligned} {}_{k|}q_{18} &= {}_kp_{18} \cdot q_{18+k}. \end{aligned} $$ These probabilities with \(k = 0, 1, 2, \ldots\) determine a discrete probability distribution. They run over all possible ages at death for the 18-year-old and express the corresponding probability to die at each of these ages.
The mortality rates \(q_x\) and the one-year survival probabilities \(p_x\) have been preloaded as qx
and px
.
This is a part of the course
“Life Insurance Products Valuation in R”
Exercise instructions
- Define
kpx
as the survival probabilities \({}_kp_{18}\) of an 18-year-old for \(k = 0, 1, 2, \ldots\) - Assign the deferred mortality probabilities \({}_{k|}q_{18}\) to the variable
kqx
by multiplyingkpx
with the mortality ratesqx
from18 + 1
untillength(px)
. - Compute the
sum()
ofkqx
to verify that it equals one. - Visualize the
kqx
against0:(length(kqx) - 1)
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Compute the survival probabilities of (18)
kpx <- c(___, ___(px[(___):(length(px) - 1)]))
# Compute the deferred mortality probabilities of (18)
kqx <- ___ * qx[(___):___]
# Print the sum of kqx
___
# Plot the deferred mortality probabilities of (18)
plot(___, ___,
pch = 20,
xlab = "k",
ylab = expression(paste(""['k|'], "q"[18])),
main = "Deferred mortality probabilities of (18)")