# Life Insurance model

This is a simple life insurance model with death benefit calculations. You can create an instance of this
project in your workspace as the following: **create a new project**, select the **“Life Insurance” sample** project,
click create.

The model includes the following group of formulas:

- create genderless Lx and Commutation tables from mortality table (optional)
- calculate frequency premium for a contract
- calculate premium reserve for a contract

You can also navigate (left menu):

- to Tests to see testing features
- to API to see how a web service API can be created from you Calculation Model.

Note

In order to continue you need to login to your workspace and create a new project using the **“Life insurance” sample** as template

## Create the genderless L table

This task shows you how to use the formulas to (re)create the genderless mortality table from a fictitious statistics including both genders. The blended mortality is calculated with 75% of male and 25% of female weights.

Note

The Genderless L table is already created for you, you can skip this task if you want.

This process takes the LwG (L with Gender) table as input and produces the L (genderless table) table as the output. Before starting you can delete this result parameter table from the Commutation numbers module as this will be the output of this process.

### Evaluate the *L* table generation formula

The formula that generates the table is the following:

${\mathit{L}}_{\mathsf{blended}}=\u27e8\left({\left(\mathit{l}\right)}_{\mathsf{age}},{\left(\mathit{l}\right)}_{\mathsf{male}}\cdot \mathrm{0.75}+{\left(\mathit{l}\right)}_{\mathsf{female}}\cdot \mathrm{0.25}\right)|\mathit{l}\in \mathsf{LwG}\u27e9$

In order to run the formula we need a *workbook*.

Create a new workbook context with these modules:

- Basic calculations
- Commutation numbers

Variables to use:

- Add $\mathit{i}$ the technical interest rate input variable (set it to some value e.g. 0 if you have no preference)
- Add ${\mathit{L}}_{\mathsf{blendedSorted}}$ output variable

Calculation output:

- Following calculations, inspect the output of the ${\mathit{L}}_{\mathsf{blendedSorted}}$ variable and download it’s contents as a CSV file.

Note

You can preview and download the contents of a variable by clicking on the arrow next to the **Result** label and choose **Table view**.
Click the arrow again to download it.

### Edit the downloaded CSV file

Add a header row:

`Age;Count`

### Upload the CSV file

- Create the new
**L**table in the Commutation numbers module. - Set first row as header
- Browse to the CSV file and load it
- Set the Domains:

- age:
`%N`

- count:
`%R`

- At this point you should be able to preview the contents of the table. If all seems ok to the import.

## Create the commutation table - *C*

This task shows you how to recreate the commutation (*C*) table. This table includes some intermediate variables
for each age to make premium calculations more efficient.

$\mathit{CN}=\u27e8\left(\mathit{x},{\mathit{l}}_{\mathit{x}},{\mathit{d}}_{\mathit{x}},{\mathit{C}}_{\mathit{x}},{\mathit{D}}_{\mathit{x}},{\mathit{M}}_{\mathit{x}},{\mathit{N}}_{\mathit{x}}\right)|\mathit{x}=\mathrm{0},\mathrm{\dots},\mathrm{card}\mathsf{L}-\mathrm{1}\u27e9$

The variables ${\mathit{l}}_{\mathit{x}},{\mathit{d}}_{\mathit{x}},{\mathit{C}}_{\mathit{x}},{\mathit{D}}_{\mathit{x}},{\mathit{M}}_{\mathit{x}},{\mathit{N}}_{\mathit{x}}$ refer to indexed functions, you can find them in the sample project’s Commutation Numbers module. The modules begin with the lookup of the L table at age x:

${\mathit{l}}_{\mathit{x}}\u2254\left({\left(\mathit{lx}\right)}_{\mathsf{count}}|\mathit{lx}\in \mathsf{L}\wedge {\left(\mathit{lx}\right)}_{\mathsf{age}}=\mathit{x}\right):\mathit{x}\in \mathbb{N}$

and the formula source for the above lookup function is below:

```
l_x := ((lx)_'count | lx (- @L /\ (lx)_'age = x) : x (- %N
```

This process assumes that you already have *L*, the genderless L table
(see previous section)

### Evaluate the Commutation sequence generation formula

Create a new workbook context with these modules:

- Basic calculations
- Commutation numbers

Variables to use:

- Add
`i`

the technical interest rate input variable - Add
`CN`

output variable, commutation numbers

Download `CN`

contents as a CSV file.

Note

You can do this as previously, after Run click on the arrow next to the **Result** label and choose **Table view**.
Click the arrow again and select **Download as CSV** option.

### Edit the downloaded CSV file

Add a header row:

`age;lx;dx;Cx;Dx;Mx;Nx`

### Upload the CSV file

Create the new `C`

table in the Commutation numbers module.

Set first row as header.

Browse to the CSV file and load it.

- Set the Domains:
- age:
`%N`

- lx:
`%R`

- dx:
`%R`

- Cx:
`%R`

- Dx:
`%R`

- Mx:
`%R`

- Nx:
`%R`

- age:

At this point you should be able to preview the contents of the table. If all seems fine, do the import.

## Reserve calculation service

The reserve calculation services are generated by the *Reserve* calculation group.
Reserve calculation will calculate reserves for a given contract for each year within the contract term given the age, term and sum assured.