← Back to Cashflow Modelling in Python

Input data

Great work with creating your first model. Now let's prepare the input data!

1. Insurance data (model point set)

In the file input.py, prepare the data for the insured person. Use the ModelPointSet class and prepare the data in a table format (DataFrame). Name your model point set policy.

The policy should contain the following attributes:

  • sum assured: 100,000 EUR (sum_assured),
  • monthly probability of death: 0.003 (mortality_rate),
  • term of the contract: 36 months (term).

Below you can find a code skeleton with missing values to complete:

# input.py

from cashflower import ModelPointSet
import pandas as pd

policy = ModelPointSet(data=pd.DataFrame({
    "sum_assured": [_____],
    "mortality_rate": [_____],
    "term": [_____],
}))

Task: Fill in the missing values according to the assumptions in your file input.py.

2. Market assumptions

Assume that the monthly interest rate is 0.5%. Save it as a scalar variable interest_rate. Place it in the same file input.py.

# input.py

interest_rate = _____

Task: Fill in the interest rate as a decimal value.

  Next