← Back to Cashflow Modelling in Python

Expected benefit & Net single premium

Fantastic work on the survival rate calculation! You are an awesome modeller! In this lesson, we will calculate two more variables: expected benefit and net single premium. Let's do it!

Expected Benefit

Define the variable expected_benefit(t) - the expected value of the benefit paid in month t.

Use the formula:

\[ \text{expected_benefit(t)} = B \cdot {}_{t-1}p_x \cdot q_{x+t-1} \]

Remember that:

  • for t = 0 and after the end of the policy term, the benefit is 0,
  • the sum assured is policy.get("sum_assured"),
  • the policy term is policy.get("term").

Complete the code below:

# model.py

@variable()
def expected_benefit(t):
    if t == 0 or t > policy.get("_____"):
        return 0
    else:
        B = policy.get("_____")
        q = policy.get("_____")
        return B * _____ * q

Task:

  • Fill in the missing attribute names (term, sum_assured, mortality_rate).
  • Complete the part of the formula corresponding to the probability of surviving to month t-1. (Use the function from the previous lesson.)

Net Single Premium

Calculate the value of the net single premium, i.e. the present value of expected benefits.

Use a recursive approach:

\[ \text{net_single_premium(t)} = \text{expected_benefit(t)} + \text{net_single_premium(t+1)} \cdot v \]

where:

  • v is the monthly discount factor,
  • the monthly interest rate is interest_rate,
  • for the last month (maximum t), the premium equals the expected benefit.

Note that the maximum value of t is defined in settings.py as T_MAX_CALCULATION.

Complete the code below:

# model.py

from settings import settings

@variable()
def net_single_premium(t):
    if t == settings["_____"]:
        return _____
    else:
        v = 1 / (1 + _____)
        return _____ + v * _____

Task:

  • Fill in the name of the parameter from settings.py that defines the maximum t,
  • Insert the appropriate variables into the formula (e.g. expected_benefit, net_single_premium, interest_rate).
  Next