Using the LifeInsuranceContracts Package

Reinhold Kainhofer

Open Tools
reinhold@kainhofer.com

2020-09-14

The LifeInsuranceContracts package provides a full-featured framework to model classical life insurance contracts (non-unit linked). Mathematically, a general life insurance contracts can be defined using death and survival (and disability) benefit vectors to define the cash flows and calculate all premiums and reserves recursively. This powerful approach is taken by the LifeInsuranceContracts package to provide the most flexible contract modelling framework in R.

1 General Overview of the Concepts

An insurance contract is described by three different objects;

The tariff and the profit scheme are purely descriptional and their creation does not trigger any calculations. However, when one creates a contract for a given tariff, the following steps are done to calculate all values relevant for the contract:

All steps after the cash flow setup are implemented in a very generic way, as the cash flows fully determine an insurance contract and as soon as the cash flows are fixed, the valuation and reserve calculation can be expressed in terms of expected present values of the cash flows only.

While this might at first seem a bit complicated, it allows for very generic implementations of life insurance products and contracts.

2 A simple example: Term life insurance

To understand how the package implements life insurance contracts, let us look at a simple example:

2.1 Product description

Term Life Insurance

Costs:

Surrender Value:

2.2 Tariff implementation (InsuranceTarif)

library(magrittr)
library(MortalityTables)
library(LifeInsuranceContracts)
mortalityTables.load("Austria_Census")

Tarif.L71U = InsuranceTarif$new(
    name = "L71-U",
    type = "wholelife",
    tarif = "DeathPlus - Short Term Life Insurance",
    desc = "Term Life insurance (5 years) with constant sum insured and regular premiums",
    policyPeriod = 5, premiumPeriod = 5,  # premiumPeriod not needed, defaults to maturity

    mortalityTable = mortalityTable.mixed(
      table1 = mort.AT.census.2011.male, weight1 = 0.65, 
      table2 = mort.AT.census.2011.female, weight2 = 0.35
    ),
    i = 0.005, 
    tax = 0.04, 
    costs = initializeCosts(alpha = 0.05, gamma = 0.01, gamma.paidUp = 0.01, unitcosts = 10),
    surrenderValueCalculation = function(surrenderReserve, params, values) { 
      surrenderReserve * 0.9 
    }
);

2.3 Creating a contract

With the above product / tariff definition, it is now easy to instantiate one particular contract for this tariff. All we need to do is pass the tariff and the corresponding contract-specific information (mainly age, sum insured and contract closing) to the InsuranceContract object:

contract.L71U  = InsuranceContract$new(
  Tarif.L71U, 
  age = 35, 
  contractClosing = as.Date("2020-08-18"), 
  sumInsured = 100000);

Just creating the contract will already calculate all cash flows, present values, premiums, reserves, etc. for the whole contract period. They can be accessed through the contract.L71U$Values list.

A full list of all possible arguments can be found in the section [All possible parameters and their default values].

Once the contract is created, all values can be accessed like this:

contract.L71U$Values$premiums
x
unit.net 0.0008083
unit.Zillmer 0.0008083
unit.gross 0.0113840
net 80.8263742
Zillmer 80.8263742
gross 1138.4019890
unitcost 10.0000000
written_yearly 1194.3380685
written_beforetax 1148.4019890
tax 45.9360796
written 1194.3380685
contract.L71U$Values$reserves
Table continues below
  SumInsured net Zillmer adequate gamma contractual conversion alphaRefund reduction
0 100000 0.00 0.00 0.00 0 0.00 0.00 0 0.00
1 100000 10.91 10.91 -217.41 0 10.91 10.91 0 10.91
2 100000 17.13 17.13 -154.60 0 17.13 17.13 0 17.13
3 100000 18.02 18.02 -96.80 0 18.02 18.02 0 18.02
4 100000 12.67 12.67 -44.90 0 12.67 12.67 0 12.67
5 100000 0.00 0.00 0.00 0 0.00 0.00 0 0.00
  PremiumsPaid Surrender PremiumFreeSumInsured
0 1138.40 0.00 0.00
1 2276.80 9.82 228.43
2 3415.21 15.42 475.74
3 4553.61 16.22 746.15
4 5692.01 11.40 1042.97
5 5692.01 0.00 0.00

Looking back at the definition of the tariff, the only spot where the type of insurance actually came in was the type argument of the InsuranceTarif definition. This is one of the most important flags and is central to correct implementation of a tarif. On the other hand, all it does is to cause different vectors of survival, death and guaranteed cash flows. Once the cash flows are determined, the insurance contract and tariff does not need the insurance type any more.

In our term life example, the insurance contract’s unit cash flows are 1 for death benefits (both when premiums are paid and when the contract is paid-up) and for premiums in advance. All other cash flows (guaranteed, survival or disease cash flows) are zero. Similarly, the cost structure described above and implemented by the LifeInsuranceContracts::initializeCosts() function defines all cost cash flows, which are the starting point for all further calculations (only relevant columns of the data.frame are shown):

contract.L71U$Values$cashFlows
  premiums_advance premiums_arrears death_SumInsured death_GrossPremium death_PremiumFree
0 1 0 1 0 1
1 1 0 1 0 1
2 1 0 1 0 1
3 1 0 1 0 1
4 1 0 1 0 1
5 0 0 0 0 0
contract.L71U$Values$cashFlowsCosts
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0.01 0.01 0
1 0 0 0 0.01 0.01 0
2 0 0 0 0.01 0.01 0
3 0 0 0 0.01 0.01 0
4 0 0 0 0.01 0.01 0
5 0 0 0 0.00 0.00 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0.05 0 0 0 0 0
1 0.00 0 0 0 0 0
2 0.00 0 0 0 0 0
3 0.00 0 0 0 0 0
4 0.00 0 0 0 0 0
5 0.00 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 10
1 0 0 0 0 0 10
2 0 0 0 0 0 10
3 0 0 0 0 0 10
4 0 0 0 0 0 10
5 0 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0

Once these unit cash flows are set, all insurance contracts are handled identically. First, present values of each of the cash flows are calculated, from which the premiums can be calculated by the equivalence principle.

contract.L71U$Values$presentValues
  premiums death_SumInsured death_GrossPremium death_Refund_future death_PremiumFree
0 4.94307 0.00400 0 0 0.00400
1 3.96558 0.00331 0 0 0.00331
2 2.98265 0.00258 0 0 0.00258
3 1.99416 0.00179 0 0 0.00179
4 1.00000 0.00093 0 0 0.00093
5 0.00000 0.00000 0 0 0.00000
contract.L71U$Values$presentValuesCosts
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0.0494 0.0494 0
1 0 0 0 0.0397 0.0397 0
2 0 0 0 0.0298 0.0298 0
3 0 0 0 0.0199 0.0199 0
4 0 0 0 0.0100 0.0100 0
5 0 0 0 0.0000 0.0000 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0.05 0 0 0 0 0
1 0.00 0 0 0 0 0
2 0.00 0 0 0 0 0
3 0.00 0 0 0 0 0
4 0.00 0 0 0 0 0
5 0.00 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 49.4307
1 0 0 0 0 0 39.6558
2 0 0 0 0 0 29.8265
3 0 0 0 0 0 19.9416
4 0 0 0 0 0 10.0000
5 0 0 0 0 0 0.0000
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
contract.L71U$Values$premiums
  .
unit.net 0.00
unit.Zillmer 0.00
unit.gross 0.01
net 80.83
Zillmer 80.83
gross 1138.40
unitcost 10.00
written_yearly 1194.34
written_beforetax 1148.40
tax 45.94
written 1194.34

The actual calculation of the premiums has to be in the order gross premium, Zillmer premiuem, then net premium. The reason for this particular order is that some tariffs have a gross premium refund in case of death. So to calculate the net premium, the gross premium is required.

The premiums allow the unit cash flows and present values to be converted to monetary terms (fields contract.L71U$Values$absCashFlows and contract.L71U$Values$absPresentValues). Also, the reserves of the contract can be calculated.

contract.L71U$Values$reserves
Table continues below
  SumInsured net Zillmer adequate gamma contractual conversion alphaRefund reduction
0 100000 0 0 0 0 0 0 0 0
1 100000 11 11 -217 0 11 11 0 11
2 100000 17 17 -155 0 17 17 0 17
3 100000 18 18 -97 0 18 18 0 18
4 100000 13 13 -45 0 13 13 0 13
5 100000 0 0 0 0 0 0 0 0
  PremiumsPaid Surrender PremiumFreeSumInsured
0 1138 0.0 0
1 2277 9.8 228
2 3415 15.4 476
3 4554 16.2 746
4 5692 11.4 1043
5 5692 0.0 0

Also, the premium composition into costs, risk premium, savings premium and other components is possible.

contract.L71U$Values$premiumComposition
charged tax unitcosts gross gamma beta alpha alpha.noZillmer alpha.Zillmer net risk savings
1194.34 45.94 10 1138.4 1000 0 57.58 57.58 0 80.83 69.97 10.85
1194.34 45.94 10 1138.4 1000 0 57.58 57.58 0 80.83 74.69 6.14
1194.34 45.94 10 1138.4 1000 0 57.58 57.58 0 80.83 80.03 0.80
1194.34 45.94 10 1138.4 1000 0 57.58 57.58 0 80.83 86.24 -5.41
1194.34 45.94 10 1138.4 1000 0 57.58 57.58 0 80.83 93.50 -12.67
0.00 0.00 0 0.0 1000 0 57.58 57.58 0 80.83 0.00 0.00

As we see, the whole history and future of the contract is calculated as soon as it is created. It is, however, also possible to modify a contract later on, e.g. by stopping premium payments and converting it to a paid-up contract.

contract.L71U = contract.L71U$premiumWaiver(t = 3)
contract.L71U$Values$reserves
Table continues below
  SumInsured net Zillmer adequate gamma contractual conversion alphaRefund reduction
0 100000.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0.00
1 100000.00 10.91 10.91 -217.41 0.00 10.91 10.91 0 10.91
2 100000.00 17.13 17.13 -154.60 0.00 17.13 17.13 0 17.13
3 746.15 1.34 1.34 16.22 14.88 16.22 16.22 0 16.22
4 746.15 0.70 0.70 8.16 7.46 8.16 8.16 0 8.16
5 746.15 0.00 0.00 0.00 0.00 0.00 0.00 0 0.00
  PremiumsPaid Surrender PremiumFreeSumInsured
0 1138.40 0.00 0.00
1 2276.80 9.82 228.43
2 3415.21 15.42 475.74
3 3415.21 16.22 746.15
4 3415.21 8.16 746.15
5 3415.21 0.00 0.00

2.4 Creating tables with various parameters

When prototyping a new product or creating marketing material, it is often needed to create tables of premiums, reserves, benefits or surrender values for different parameters (e.g. different ages, maturities and sums insured for the marketing department, or different guaranteed interest rates, mortality tables or costs for the product development group).

This can be easily done by the functions contractGridPremium() or contractGrid(). They take one argument axes, which gives the parameters for the axes of the table (more than two dimensions are possible!), while all other parameters are passed unchanged to InsuranceContract$new().

First, let us create a grid of premiums for different ages and maturities (for sum insured 100,000 Euro):

grd = contractGridPremium(
  axes = list(age = seq(20, 80, 5), policyPeriod = seq(10, 40, 5)),
  tarif = Tarif.L71U, 
  contractClosing = as.Date("2020-08-18"), 
  sumInsured = 100000
)
grd
age
policyPeriod
10 15 20 25 30 35 40
20 1226.97 1288.25 1369.67 1494.03 1704.47 2049.68 2595.39
25 1227.50 1311.22 1439.08 1655.45 2010.37 2571.46 3403.05
30 1256.61 1388.06 1610.50 1975.39 2552.22 3407.16 4549.65
35 1329.56 1558.39 1933.75 2527.14 3406.63 4581.92 6162.21
40 1480.91 1867.64 2478.99 3385.10 4595.97 6224.08 8581.45
45 1749.39 2381.32 3317.94 4569.58 6252.52 8689.26 12082.95
50 2179.00 3153.01 4454.64 6204.78 8738.83 12268.04 16160.61
55 2819.25 4186.05 6023.83 8684.78 12390.71 16478.20 19388.53
60 3654.46 5613.83 8450.81 12401.91 16759.81 19862.68 21019.86
65 4824.56 7911.21 12210.02 16951.43 20327.37 21586.39 21586.39
70 6942.90 11749.48 17050.94 20825.64 22233.37 22233.37 22233.37
75 10834.54 17077.83 21523.12 23180.94 23180.94 23180.94 23180.94
80 16763.64 22608.06 24787.67 24787.67 24787.67 24787.67 24787.67

One can also pass more than two dimensions to the axes:

grd = contractGridPremium(
  axes = list(age = seq(20, 80, 10), policyPeriod = seq(10, 40, 10), sumInsured = c(10000, 50000, 100000)),
  tarif = Tarif.L71U, 
  contractClosing = as.Date("2020-08-18")
)
grd
age
policyPeriod
10 20 30 40
20 132.06 146.33 179.81 268.90
30 135.02 170.41 264.58 464.33
40 157.45 257.26 468.96 867.51
50 227.26 454.82 883.24 1625.42
60 374.81 854.44 1685.34 2111.35
70 703.65 1714.45 2232.70 2232.70
80 1685.72 2488.13 2488.13 2488.13
age
policyPeriod
10 20 30 40
20 618.69 690.04 857.43 1302.90
30 633.51 810.45 1281.31 2280.03
40 745.66 1244.70 2303.18 4295.93
50 1094.70 2232.52 4374.62 8085.51
60 1832.43 4230.60 8385.11 10515.13
70 3476.65 8530.67 11121.88 11121.88
80 8387.02 12399.04 12399.04 12399.04
age
policyPeriod
10 20 30 40
20 1226.97 1369.67 1704.47 2595.39
30 1256.61 1610.50 2552.22 4549.65
40 1480.91 2478.99 4595.97 8581.45
50 2179.00 4454.64 8738.83 16160.61
60 3654.46 8450.81 16759.81 21019.86
70 6942.90 17050.94 22233.37 22233.37
80 16763.64 24787.67 24787.67 24787.67

One can use any of the parameters of the InsuranceContract$new() call in the axes argument, even the tarif or mortalityTable parameters. This means that one can create tables comparing different tariffs, or showing the effect of different life tables.

In the following example, we use the tarif Tarif.L71U, but instead of the unisex table (mixed 65:35 from male:female tables), we use the male mortality tables of the Austrian census from 1870 to 2011 (with a contract period of 10 years fixed, and varying ages):

grd = contractGridPremium(
  axes = list(mortalityTable = mort.AT.census["m", ], age = seq(20, 80, 10)),
  tarif = Tarif.L71U, 
  sumInsured = 100000,
  contractClosing = as.Date("2020-08-18")
) 
grd
  20 30 40 50 60 70 80
ÖVSt 1868/71 M 2196.2 2266.9 2729.5 3633.2 6045.2 11993.8 25050.0
ÖVSt 1879/82 M 2125.8 2260.8 2656.7 3579.8 5660.1 11385.1 24373.1
ÖVSt 1889/92 M 1979.6 2108.8 2584.7 3435.2 5619.3 11166.0 23959.4
ÖVSt 1899/1902 M 1811.4 1985.5 2468.2 3382.7 5441.2 10630.8 21946.0
ÖVSt 1909/12 M 1741.3 1931.3 2396.9 3345.0 5399.1 10374.0 21291.8
ÖVSt 1930/33 M 1540.6 1646.7 1980.9 2768.4 4569.0 9010.1 19923.5
ÖVSt 1949/51 M 1358.5 1391.3 1614.9 2433.8 4123.8 8124.9 17960.0
ÖVSt 1959/61 M 1334.4 1353.6 1513.6 2232.3 4128.9 7980.8 17180.7
ÖVSt 1970/72 M 1336.7 1338.4 1580.6 2178.1 3933.2 8459.4 17202.5
ÖVSt 1980/82 M 1299.0 1293.1 1516.3 2169.5 3467.3 7198.6 16340.6
ÖVSt 1990/92 M 1248.9 1257.3 1435.3 1887.9 3135.3 5839.9 13587.2
ÖVSt 2000/02 M 1216.4 1209.3 1350.8 1763.0 2552.7 4845.2 11393.3
ÖVSt 2010/2012 M 1189.9 1186.7 1273.1 1606.2 2434.8 3968.0 9476.2

3 All possible parameters

All possible parameters of an insurance contract are stored in sub-lists of a a structure InsuranceContract.Parameters. If not provided by the call to InsuranceContract$new(), the values will be taken from either the InsuranceTariff’s default parameters, the ProfitParticipation’s default parameters or the global defaults in the InsuranceContract.ParameterDefault. The cascade or parameters is (from top to bottom):

In addition to the parameters listed below, the InsuranceContract$new() constructor function takes the following parameters

str(InsuranceContract.ParameterDefaults)
#> List of 8
#>  $ ContractData       :List of 23
#>   ..$ id                    : chr "Hauptvertrag"
#>   ..$ sumInsured            : num 100000
#>   ..$ YOB                   : NULL
#>   ..$ age                   : NULL
#>   ..$ technicalAge          : NULL
#>   ..$ ageDifferences        : NULL
#>   ..$ sex                   : chr "unisex"
#>   ..$ policyPeriod          : num 25
#>   ..$ premiumPeriod         : NULL
#>   ..$ deferralPeriod        : num 0
#>   ..$ guaranteedPeriod      : num 0
#>   ..$ contractClosing       : NULL
#>   ..$ blockStart            : num 0
#>   ..$ premiumPayments       : chr "in advance"
#>   ..$ benefitPayments       : chr "in advance"
#>   ..$ premiumFrequency      : num 1
#>   ..$ benefitFrequency      : num 1
#>   ..$ widowProportion       : num 0
#>   ..$ deathBenefitProportion: num 1
#>   ..$ premiumRefund         : num 0
#>   ..$ premiumIncrease       : num 1
#>   ..$ annuityIncrease       : num 1
#>   ..$ deathBenefit          : num 1
#>  $ ContractState      :List of 3
#>   ..$ premiumWaiver   : logi FALSE
#>   ..$ surrenderPenalty: logi TRUE
#>   ..$ alphaRefunded   : logi FALSE
#>  $ ActuarialBases     :List of 9
#>   ..$ mortalityTable           : NULL
#>   ..$ invalidityTable          : NULL
#>   ..$ invalidityEndsContract   : logi TRUE
#>   ..$ i                        : num 0
#>   ..$ balanceSheetDate         : Date[1:1], format: "1900-12-31"
#>   ..$ balanceSheetMethod       : chr "30/360"
#>   ..$ surrenderValueCalculation: NULL
#>   ..$ premiumFrequencyOrder    : num 0
#>   ..$ benefitFrequencyOrder    : num 0
#>  $ Costs              : num [1:6, 1:6, 1:4] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..- attr(*, "dimnames")=List of 3
#>   .. ..$ type     : chr [1:6] "alpha" "Zillmer" "beta" "gamma" ...
#>   .. ..$ basis    : chr [1:6] "SumInsured" "SumPremiums" "GrossPremium" "NetPremium" ...
#>   .. ..$ frequency: chr [1:4] "once" "PremiumPeriod" "PremiumFree" "PolicyPeriod"
#>  $ Loadings           :List of 14
#>   ..$ ongoingAlphaGrossPremium: num 0
#>   ..$ tax                     : num 0.04
#>   ..$ unitcosts               : num 0
#>   ..$ security                : num 0
#>   ..$ noMedicalExam           : num 0
#>   ..$ noMedicalExamRelative   : num 0
#>   ..$ sumRebate               : num 0
#>   ..$ extraRebate             : num 0
#>   ..$ premiumRebate           : num 0
#>   ..$ partnerRebate           : num 0
#>   ..$ extraChargeGrossPremium : num 0
#>   ..$ benefitFrequencyLoading :List of 4
#>   .. ..$ 1 : num 0
#>   .. ..$ 2 : num 0
#>   .. ..$ 4 : num 0
#>   .. ..$ 12: num 0
#>   ..$ premiumFrequencyLoading :List of 4
#>   .. ..$ 1 : num 0
#>   .. ..$ 2 : num 0
#>   .. ..$ 4 : num 0
#>   .. ..$ 12: num 0
#>   ..$ alphaRefundPeriod       : num 5
#>  $ Features           :List of 2
#>   ..$ betaGammaInZillmer: logi FALSE
#>   ..$ alphaRefundLinear : logi TRUE
#>  $ ProfitParticipation:List of 16
#>   ..$ advanceProfitParticipation            : num 0
#>   ..$ advanceProfitParticipationInclUnitCost: num 0
#>   ..$ waitingPeriod                         : NULL
#>   ..$ guaranteedInterest                    : NULL
#>   ..$ interestProfitRate                    : NULL
#>   ..$ totalInterest                         : NULL
#>   ..$ mortalityProfitRate                   : NULL
#>   ..$ expenseProfitRate                     : NULL
#>   ..$ sumProfitRate                         : NULL
#>   ..$ terminalBonusRate                     : NULL
#>   ..$ terminalBonusFundRate                 : NULL
#>   ..$ profitParticipationScheme             : NULL
#>   ..$ profitComponents                      : NULL
#>   ..$ profitClass                           : NULL
#>   ..$ profitRates                           : NULL
#>   ..$ scenarios                             : list()
#>  $ Hooks              :List of 2
#>   ..$ adjustCashFlows     : NULL
#>   ..$ adjustCashFlowsCosts: NULL
# pandoc.listRK(InsuranceContract.ParameterDefaults)

4 Tarif and Contract Specification

An insurance contract is modelled by the abstract product specification (InsuranceTarif class) and the concrete (individualized) InsuranceContract.

The insurance contract and the underlying insurance tariff have the same possible parameters in its constructors: The InsuranceTarif uses them to define defaults for contracts that use the tariff, while the parameters passed to the contract either provide the individually required data like age, sum insured or maturity, or they can override the defaults provided by the tariff. In theory, one could even create a contract with an empty underlying tariff and provide all tariff-specific parameters also in the contract’s new call.

4.1 Creating the tariff

The InsuranceTarif class provides a way to define an abstract insurance product. The most important parameters to be passed in the InsuranceTarif$new() call are:

General settings for the Tariff
name, tarif, desc IDs and human-readable descriptions of the insurance product. They are just used as labels and array keys, but do not influence the calculations.
type the most important parameter, defining the type of life insurance product (endowment, pure endowment, annuity, whole life insurance, dread-disease insurance, etc.)
Actuarial Bases for the Tariff
mortalityTable a MortalityTable Object (package “MortalityTables”), providing the transition probabilities (typically death probabilities, but potentially also morbidity in dread-disease insurances)
i Guaranteed interest rate
costs, unitcosts passed a data structure for all cost parameters (see below)
premiumFrequencyLoading surcharge for premium payments more often than yearly (as a named list)
premiumRefund how much of the (gross) premium paid is returned upon death (often provided e.g. in deferred annuities or pure endowments with no fixed death benefit)
tax insurance tax
Benefit calculation
surrenderValueCalculation can be passed a hook function that calculates the surrender value given the current reserves at each time step

A typical call looks like the following for a pure endowment with gross premium refund upon death and a linearly decreasing surrender penalty:

Tarif.PureEnd = InsuranceTarif$new(
  name = "Example Tariff - Pure Endowment",
  type = "pureendowment",
  tarif = "PE1-RP",
  desc = "A pure endowment with regular premiums (standard tariff)",

  mortalityTable = mort.AT.census.2011.unisex,
  i = 0.005,
  # Costs: 4% acquisition, where 2.5% are zillmered, 5\% of each premium as beta costs, 
  #        1%o administration costs of the sum insured over the whole contract period
  costs = initializeCosts(alpha = 0.04, Zillmer = 0.025, beta = 0.05, gamma.contract = 0.001, gamma.paidUp = 0.001),
  unitcosts = 10,

  # Yearly premiums get no surcharge, monthly premiums add +4%
  premiumFrequencyLoading = list("1" = 0, "12" = 0.04),
  premiumRefund = 1,  # Full gross premium refund upon death
  tax = 0.04,         # 4% insurance tas

  surrenderValueCalculation = function(surrenderReserve, params, values) {
    n = params$ContractData$policyPeriod
    # Surrender Penalty is 10% at the beginning and decreases linearly to 0%
    surrenderReserve * (0.9 + 0.1 * (0:n)/n)
  }
)

Many parameters do not need to be given explicitly, but instead use sensible defaults (like the premiumPeriod, which by default equals the whole contract period, i.e. regular premium payments over the whole contract duration).

To create a similar tariff with some changes, one can call the createModification method of the InsuranceTarif clas, which takes as arguments all insurance parameters that should be changed for the new tarif.

To create a single-premium version of the pure endowment shown above, one can simply use a call like:

Tarif.PureEnd.SP = Tarif.PureEnd$createModification(
  name = "Example Tariff - Pure Endowment (SP)",
  tarif = "PE1-SP",
  desc = "A pure endowment with single premiums",
  premiumPeriod = 1
)

4.1.1 Sample tariffs for the most common life insurance types

For the examples in the remainder of this vignette, we can create some more example tariffs covering the most common types of life insurance.

General definitions for all tariffs

library(MortalityTables)
mortalityTables.load("Austria_Census")
mortalityTables.load("Austria_Annuities_AVOe2005R")
  # Costs: 4% acquisition, where 2.5% are zillmered, 5\% of each premium as beta costs, 
  #        1%o acquisition costs of the sum insured over the whole contract period
example.Costs = initializeCosts(
  alpha = 0.04, Zillmer = 0.025, 
  beta = 0.05, 
  gamma.contract = 0.001, gamma.paidUp = 0.001
)
example.Surrender = function(surrenderReserve, params, values) {
    n = params$ContractData$policyPeriod
    # Surrender Penalty is 10% at the beginning and decreases linearly to 0%
    surrenderReserve * (0.9 + 0.1 * (0:n)/n)
}

Endowment

Tarif.Endowment = InsuranceTarif$new(
  name = "Example Tariff - Endowment",
  type = "endowment",
  tarif = "EN1",
  desc = "An endowment with regular premiums",

  mortalityTable = mort.AT.census.2011.unisex,
  i = 0.005,
  costs = example.Costs,
  unitcosts = 10,
  tax = 0.04,         # 4% insurance tax
  surrenderValueCalculation = example.Surrender
)

Whole / Term Life Insurance

Tarif.Life = InsuranceTarif$new(
  name = "Example Tariff - Whole/Term Life",
  type = "wholelife",
  tarif = "Life1",
  desc = "A whole or term life insurance with regular premiums",

  mortalityTable = mort.AT.census.2011.unisex,
  i = 0.005,
  costs = example.Costs,
  unitcosts = 10,
  tax = 0.04,         # 4% insurance tax
  surrenderValueCalculation = example.Surrender
)

Immediate Annuity (single premium)

Tarif.ImmAnnuity = InsuranceTarif$new(
  name = "Example Tariff - Immediate Annuity",
  type = "annuity",
  tarif = "Ann1",
  desc = "An annuity with single-premium",
  premiumPeriod = 1,

  mortalityTable = AVOe2005R.unisex,
  i = 0.005,
  costs = example.Costs,
  tax = 0.04         # 4% insurance tax
)

Deferred Annuity

# Premium periods and deferral periods can also be given as a function of other
# contract parameters (like the age at contract inception, etc.)
Tarif.DefAnnuity = InsuranceTarif$new(
  name = "Example Tariff - Deferred Annuity",
  type = "annuity",
  tarif = "Life1",
  desc = "A deferred annuity (life-long payments start at age 65) with reg. premiums",

  contractPeriod = function(params, values) { 120 - params$ContractData$age},
  deferralPeriod = function(params, values) { 65 - params$ContractData$age},
  premiumPeriod = function(params, values) { 65 - params$ContractData$age},
    
  mortalityTable = AVOe2005R.unisex,
  i = 0.005,
  costs = example.Costs,
  tax = 0.04,         # 4% insurance tax
  surrenderValueCalculation = example.Surrender
)

Dread-Disease Insurance

# An example dread-disease tariff, morbidity is assumed linearly increasing with age
ddTable = mortalityTable.period(name = "Linear dread-disease table", 
                                ages = 0:100, deathProbs = 0:100/500)
Tarif.DreadDisease = InsuranceTarif$new(
  name = "Example Tariff - Dread-Disease",
  type = "dread-disease",
  tarif = "DD1",
  desc = "A dread disease insurance with a lump-sum payment upon diagnosis",

  sumInsured = 50000,
  mortalityTable = mort.AT.census.2011.unisex,
  invalidityTable = ddTable,
  i = 0.005,
  costs = example.Costs,
  unitcosts = 10,
  tax = 0.04,         # 4% insurance tax
  surrenderValueCalculation = example.Surrender
)

4.2 Creating a contract

While the tariff describes the general product features, the contract object holds the data of a concrete contract. All insurance parameters (see section [All possible parameters and their default values]) can be given to override tarif defaults.

However, the most important and often used parameters are:

Information about insuree
age the age of the insured person at contract start
YOB the year of birth of the insured person (age, YOB and contractClosing are redundant, at most two need to be given). YOB is only relevant for cohort mortality tables. For period life tables (which are independent of the birth year of the person), this parameter is not needed.
sex relevant for sex-specific life tables (common in the past)
Contract details
sumInsured the benefit when the insured event happens. Typically the lump sum for whole life insurances or endowments, or the (yearly) payment for annuities
policyPeriod the duration of the whole contract
premiumPeriod how long premiums are paid (1 for single-premiumcontracts, equal to policyPeriod (default) for regular premiums)
premiumFrequency how often premiums are paid within a year (e.g.1 for yearly premiums, 4 for quarterly, 12 for monthly)
contractClosing the starting date of the contract
deathBenefitProportion gives the factor of death benefit relative to thesurvival benefit of endowments (1 means equal death and survival probabilities)
noMedicalExam, noMedicalExamRelative, sumRebate, extraRebate, premiumRebate various types of rebates or charges. They can either be defined in general functional form in the tariff to apply to all contracts, or given individually for each contract. For the details, when each of these rebates are applied, check the formula reference document.

For the pure endowments defined above, a typical contract would be created like this:

contract.PureEnd = InsuranceContract$new(
    Tarif.PureEnd,
    age = 50, policyPeriod = 20, 
    premiumFrequency = 12,
    sumInsured = 100000,
    contractClosing = as.Date("2020-07-01")
  )
contract.PureEnd$Values$premiums
x
unit.net 0.0482
unit.Zillmer 0.0497
unit.gross 0.0543
net 4817.9981
Zillmer 4968.6504
gross 5432.8180
unitcost 10.0000
written_yearly 5886.9519
written_beforetax 471.7109
tax 18.8684
written 490.5793
contract.PureEnd$Values$premiumComposition
Table continues below
t charged tax loading.frequency gross gamma beta alpha alpha.noZillmer alpha.Zillmer
0 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
1 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
2 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
3 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
4 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
5 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
6 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
7 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
8 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
9 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
10 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
11 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
12 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
13 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
14 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
15 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
16 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
17 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
18 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
19 5886.95 226.42 217.71 5432.82 100.57 273.2 241.04 90.39 150.65
20 0.00 0.00 0.00 0.00 100.57 273.2 241.04 90.39 150.65
Zillmer net risk savings
4968.65 4818 1.71 4799.10
4968.65 4818 3.73 4796.42
4968.65 4818 6.07 4793.35
4968.65 4818 8.77 4789.86
4968.65 4818 11.88 4785.89
4968.65 4818 15.45 4781.36
4968.65 4818 19.55 4776.20
4968.65 4818 24.22 4770.35
4968.65 4818 29.50 4763.79
4968.65 4818 35.43 4756.48
4968.65 4818 41.98 4748.46
4968.65 4818 49.15 4739.75
4968.65 4818 56.81 4730.52
4968.65 4818 65.04 4720.66
4968.65 4818 73.76 4710.29
4968.65 4818 82.96 4699.40
4968.65 4818 92.68 4687.94
4968.65 4818 103.33 4675.40
4968.65 4818 115.22 4661.38
4968.65 4818 128.48 4645.75
4968.65 4818 0.00 0.00

Due to the full premium refund in case of death, there is only very little biometric risk involved. If the premium refund is not included in the contract, then we have a negative biometric risk over the whole period (i.e. negative risk premium, because upon death the existing reserves is shared with the collective). The premium refund can be overridden directly in the contract call:

contract.PureEnd.NoRefund = InsuranceContract$new(
    Tarif.PureEnd,
    age = 50, policyPeriod = 20, 
    premiumFrequency = 12,
    sumInsured = 100000,
    contractClosing = as.Date("2020-07-01"),
    premiumRefund = 0
  )
cbind(`With refund` = contract.PureEnd$Values$premiums, `Without refund` = contract.PureEnd.NoRefund$Values$premiums)
  With refund Without refund
unit.net 0.05 0.04
unit.Zillmer 0.05 0.04
unit.gross 0.05 0.05
net 4818.00 4292.43
Zillmer 4968.65 4426.99
gross 5432.82 4852.30
unitcost 10.00 10.00
written_yearly 5886.95 5259.07
written_beforetax 471.71 421.40
tax 18.87 16.86
written 490.58 438.26
cbind(
  `Gross premium with refund` = contract.PureEnd$Values$premiumComposition[,"gross"],
  `Gross premium w/o refund` = contract.PureEnd.NoRefund$Values$premiumComposition[,"gross"],
  `Risk premium with refund` = contract.PureEnd$Values$premiumComposition[,"risk"],
  `Risk premium w/o refund` = contract.PureEnd.NoRefund$Values$premiumComposition[,"risk"]
)
t Gross premium with refund Gross premium w/o refund Risk premium with refund Risk premium w/o refund
0 5432.82 4852.3 1.71 -12.11
1 5432.82 4852.3 3.73 -26.92
2 5432.82 4852.3 6.07 -44.84
3 5432.82 4852.3 8.77 -66.30
4 5432.82 4852.3 11.88 -91.89
5 5432.82 4852.3 15.45 -122.31
6 5432.82 4852.3 19.55 -158.51
7 5432.82 4852.3 24.22 -201.26
8 5432.82 4852.3 29.50 -251.29
9 5432.82 4852.3 35.43 -309.46
10 5432.82 4852.3 41.98 -376.25
11 5432.82 4852.3 49.15 -452.12
12 5432.82 4852.3 56.81 -536.75
13 5432.82 4852.3 65.04 -631.40
14 5432.82 4852.3 73.76 -736.07
15 5432.82 4852.3 82.96 -851.54
16 5432.82 4852.3 92.68 -979.04
17 5432.82 4852.3 103.33 -1123.92
18 5432.82 4852.3 115.22 -1291.25
19 5432.82 4852.3 128.48 -1484.28
20 0.00 0.0 0.00 0.00

To create a single-premium contract, one can either use the single-premium tarif defined above, or simply pass premiumPeriod=1 to the call:

contract.PureEnd.SP1 = InsuranceContract$new(
    Tarif.PureEnd,
    age = 40, policyPeriod = 45, premiumPeriod = 1,
    sumInsured = 100000,
    contractClosing = as.Date("2020-07-01")
  )
contract.PureEnd.SP2 = InsuranceContract$new(
    Tarif.PureEnd.SP,
    age = 40, policyPeriod = 45, # premiumPeriod already set by tariff!
    sumInsured = 100000,
    contractClosing = as.Date("2020-07-01")
  )

all_equal(contract.PureEnd.SP1$Values$reserves, contract.PureEnd.SP2$Values$reserves)
#> [1] TRUE

4.3 Premium Waivers

After a while, many customers do not want to pay premiums for the contract any more and convert the contract to a paid-up contract. The unit benefit cash flows from that moment on stay the same, but the sum insured is adjusted, so that the existing reserve is able to cover all future benefits and costs. Furthermore, paid-up contracts typically have differen costs / loadings. Additionally, the surrender penalty is usually applied to the reserve before the conversion.

Waiving premiums and recalculating the sum insured is very easy, one just calls the method InsuranceContract$premiumWaiver(t = ..) on the existing contract.

contract.PureEnd.NoRefund.Prf = contract.PureEnd.NoRefund$clone()$premiumWaiver(t = 7)
contract.PureEnd.NoRefund.Prf$Values$reserves
Table continues below
  SumInsured net Zillmer adequate gamma contractual conversion alphaRefund reduction
0 100000.00 0.00 -2426.15 0.00 0.00 -2426.15 -2426.15 2426.15 0.00
1 100000.00 4310.67 2000.61 615.32 0.22 2000.83 2000.83 1940.92 3941.75
2 100000.00 8657.19 6463.45 5148.65 0.42 6463.87 6463.87 1455.69 7919.56
3 100000.00 13042.79 10965.62 9721.42 0.61 10966.23 10966.23 970.46 11936.69
4 100000.00 17471.20 15510.84 14337.34 0.79 15511.63 15511.63 485.23 15996.86
5 100000.00 21946.68 20103.43 19000.74 0.95 20104.38 20104.38 0.00 20104.38
6 100000.00 26474.26 24748.40 23716.65 1.10 24749.50 24749.50 0.00 24749.50
7 32955.02 27142.02 27142.02 27538.55 396.53 27538.55 27538.55 0.00 27538.55
8 32955.02 27433.11 27433.11 27800.58 367.47 27800.58 27800.58 0.00 27800.58
9 32955.02 27743.56 27743.56 28081.86 338.30 28081.86 28081.86 0.00 28081.86
10 32955.02 28075.30 28075.30 28384.29 309.00 28384.29 28384.29 0.00 28384.29
11 32955.02 28430.12 28430.12 28709.65 279.53 28709.65 28709.65 0.00 28709.65
12 32955.02 28809.75 28809.75 29059.62 249.87 29059.62 29059.62 0.00 29059.62
13 32955.02 29215.48 29215.48 29435.45 219.97 29435.45 29435.45 0.00 29435.45
14 32955.02 29649.04 29649.04 29838.83 189.79 29838.83 29838.83 0.00 29838.83
15 32955.02 30111.92 30111.92 30271.20 159.28 30271.20 30271.20 0.00 30271.20
16 32955.02 30605.82 30605.82 30734.22 128.40 30734.22 30734.22 0.00 30734.22
17 32955.02 31132.72 31132.72 31229.81 97.09 31229.81 31229.81 0.00 31229.81
18 32955.02 31696.38 31696.38 31761.67 65.29 31761.67 31761.67 0.00 31761.67
19 32955.02 32301.92 32301.92 32334.88 32.96 32334.88 32334.88 0.00 32334.88
20 32955.02 32955.02 32955.02 32955.02 0.00 32955.02 32955.02 0.00 32955.02
  PremiumsPaid Surrender PremiumFreeSumInsured
0 4852.30 0.00 0.00
1 9704.60 3567.28 4474.16
2 14556.90 7206.80 8977.10
3 19409.21 10922.07 13507.36
4 24261.51 14717.11 18063.42
5 29113.81 18596.55 22643.61
6 33966.11 23017.03 27791.02
7 33966.11 27538.55 32955.02
8 33966.11 27800.58 32955.02
9 33966.11 28081.86 32955.02
10 33966.11 28384.29 32955.02
11 33966.11 28709.65 32955.02
12 33966.11 29059.62 32955.02
13 33966.11 29435.45 32955.02
14 33966.11 29838.83 32955.02
15 33966.11 30271.20 32955.02
16 33966.11 30734.22 32955.02
17 33966.11 31229.81 32955.02
18 33966.11 31761.67 32955.02
19 33966.11 32334.88 32955.02
20 33966.11 32955.02 32955.02

Notice that the contract changes are made directly to the contract (“reference semantics”). This is different from the typical behavior of R, where any change to e.g. a data.frame leaves the original data.frame intact and instead returns a modified copy.

5 Calculation Approach

5.1 Valuation

The calculation of all contract values is controlled by the function InsuranceContract$calculateContract() (using methods of the InsuranceTarif object) and follows the following logic:

  1. First the contingent (unit) cash flows and the transition probbilities are determined.
  2. The actuarial equivalence principle states that at time of inception, the (net and gross) premium must be determined in a way that the present value of the future benefits and costs minus the present value of the future premiums must be equal, i.e. in expectation the future premiums ove the whole lifetime of the contract will exactly cover the benefits and costs. Similarly, at all later time steps, the difference between these two present values needs to be reserved (i.e. has already been paid by the customer by previous premiums).
  3. This allows the premiums to be calculated by first calculating the present values for all of the benefit and costs cash flow vectors.
  4. The formulas to calculate the gross, Zillmer and net premiums involve simple linear combinations of these present values, so the coefficients of these formulas are determined next.
  5. With the coefficients of the premium formulas calculated, all premiums can be calculated (first the gross premium, because due to potential gross premium refunds in case of death, the formula for the net premium requires the gross premium, which the formula for the gross premium involves no other type of premuim).
  6. With premiums determined, all unit cash flows and unit present values can now be expressed in monetary terms / as absolute cash flows (i.e. the actual Euro-amount that flows rather than a percentage).
  7. As described above, the difference between the present values of premiums and present values of benefits and costs is defined as the required amount of reserves, so the reserves (net, gross, administration cost, balance sheet) and all values derived from them (i.e. surrender value, sum insured in case of premium waiver, etc.) are calculated.
  8. The decomposition of the premium into parts dedicated to specific purposes (tax, rebates, net premium, gross premium, Zillmer premium, cost components, risk premium, savings premium, etc.) can be done once the reserves are ready (since e.g. the savings premium is defined as the difference of discounted reserves at times \(t\) and \(t+1\)).
  9. If the contract has (discretionary or obligatory) profit sharingB mechanisms included, the corresponding [ProfitParticipation] object can calculate that profit sharing amounts, once all guaranteed values are calculated. This can also be triggered manually (with custom profit sharing rates) by calling the methods InsuranceContract$profitScenario() or InsuranceContract$addProfitScenario().

5.2 Cash Flows

An insurance contract is basically defined by the (unit) cash flows it produces: Together with the transition probabilities (mortalityTable parameter) the present values can be calculated, from which the premiums follow and finally the reserves and a potential profit sharing.

For example, a term life insurance with regular premiums would have the following cash flows:

A single-premium term life insurance would look similar, except for the premiums:

A pure endowment has no death benefits, but a survival benefit of 1 at the maturity of the contract:

An endowment has also death benefits during the contract duration:

A (deferred) annuityB has premium cash flows only during the deferral peroid and only survival cash flows during the annuity payment phase. Often, in case of death during the deferral period, all premiums paid are refunded as a death benefit.:

A terme-fix insurance has a guaranteed payment at maturity, even if the insured has already died. The premiums, however, are only paid until death (which is not reflected in the contingent cash flows, but rather in the transition probabilities):

6 Cost structure

Costs of an insurance contracts can have various forms and bases.

The InsuranceContract class provides all common types of costs:

The cost structure generated by initializeCosts() is a three-dimensional array with the above-mentioned coordinates:

initializeCosts() %>% dimnames
#> $type
#> [1] "alpha"            "Zillmer"          "beta"             "gamma"           
#> [5] "gamma_nopremiums" "unitcosts"       
#> 
#> $basis
#> [1] "SumInsured"   "SumPremiums"  "GrossPremium" "NetPremium"   "Constant"    
#> [6] "Reserve"     
#> 
#> $frequency
#> [1] "once"          "PremiumPeriod" "PremiumFree"   "PolicyPeriod"

The most common types of cost can be directly given in the call to initializeCosts(), but for some uncommon combinations, one can directly fill any of the fields in the three-dimensional array manually.

initializeCosts(alpha = 0.04, Zillmer = 0.025, beta = 0.05, gamma.contract = 0.001)

# the above is the short form of:
costs.Bsp = initializeCosts()
costs.Bsp[["alpha", "SumPremiums", "once"]] = 0.04
costs.Bsp[["Zillmer", "SumPremiums", "once"]] = 0.025 # German Zillmer maximum
costs.Bsp[["beta", "GrossPremium", "PremiumPeriod"]] = 0.05
costs.Bsp[["gamma", "SumInsured", "PolicyPeriod"]] = 0.001

These costs parameters are immediately converted to the corresponding cash flows when the contract is created. In the above example of a pure endowment (with premium waiver at time 7), the absolute cost cash flows are:

contract.PureEnd.NoRefund$Values$absCashFlows
  alpha Zillmer beta gamma gamma_nopremiums unitcosts
0 3881.84 2426.15 242.62 100 100 0
1 0.00 0.00 242.62 100 100 0
2 0.00 0.00 242.62 100 100 0
3 0.00 0.00 242.62 100 100 0
4 0.00 0.00 242.62 100 100 0
5 0.00 0.00 242.62 100 100 0
6 0.00 0.00 242.62 100 100 0
7 0.00 0.00 242.62 100 100 0
8 0.00 0.00 242.62 100 100 0
9 0.00 0.00 242.62 100 100 0
10 0.00 0.00 242.62 100 100 0

In addition to these standardized costs, which are included in the expense-loaded premium (sometimes also called the “(actuarial) gross premium”), there are certain loadings and rebates that are applied after the expense-loaded premium \(BP_x\):

\[P_x = \left\{ (BP_x + oUZu - SuRa) \cdot VS \cdot (1-VwGew) + unitC\right\} \cdot \left(1-PrRa-VwGew_{StkK}-PartnerRa\right)\cdot \left(1+uz(k)\right) \cdot (1+tax)\]

with the following surcharges and rebates:

6.1 Frequency charges

Typically, an insurance premium is calculated with yearly premiums paid in advance. If premiums are paid more often per year (Parameter premiumFrequency or benefitFrequency set to a value larger than 1, typically 2 for half-yearly, 4 for quarterly, or 12 for monthly payments), part of the interest during the year is lost, as well as the premiums for the remainder of the year if the insured event happens. So usually there is some kind of extra charge included:

Tarif.Life.FrequencyLoading = Tarif.Life$createModification(
  name = "Term life (frequency loading)",
  premiumFrequencyLoading = list("1" = 0.0, "2" = 0.01, "4" = 0.015, "12" = 0.02)
)
Tarif.Life.FrequencyApprox1 = Tarif.Life$createModification(
  name = "Term life (k-th yearly, approx. 1.Ord.)",
  premiumFrequencyOrder = 1
)
Tarif.Life.FrequencyApprox2 = Tarif.Life$createModification(
  name = "Term life (k-th yearly, approx. 2.Ord.)",
  premiumFrequencyOrder = 2
)
Tarif.Life.FrequencyApprox3 = Tarif.Life$createModification(
  name = "Term life (k-th yearly, exact)",
  premiumFrequencyOrder = Inf
)

Tarif.Life.FrequencyExpense = Tarif.Life$createModification(
  name = "Term life (modified gamma costs)",
  costs = function(params, values) {
    switch (toString(params$ContractData$premiumFrequency),
        "12" = initializeCosts(alpha = 0.04, Zillmer = 0.025,  beta = 0.05,  gamma.contract = 0.00127, gamma.paidUp = 0.001),
        "4" = initializeCosts(alpha = 0.04, Zillmer = 0.025,  beta = 0.05,  gamma.contract = 0.00119, gamma.paidUp = 0.001),
        "2" = initializeCosts(alpha = 0.04, Zillmer = 0.025,  beta = 0.05,  gamma.contract = 0.0011, gamma.paidUp = 0.001),
        initializeCosts(alpha = 0.04, Zillmer = 0.025,  beta = 0.05,  gamma.contract = 0.001, gamma.paidUp = 0.001)
    )
  }
)

Of course, the loadings and costs mentioned above are not necessarily mathematically derived to offset the interest effect of k-th yearly payments. Rather, they are often simply decided by the management. Thus, the three approaches implemented here can have quite different results:

contractGridPremium(
  axes = list(tarif = c(Tarif.Life.FrequencyLoading, Tarif.Life.FrequencyApprox1, 
                        Tarif.Life.FrequencyApprox2, Tarif.Life.FrequencyApprox3, 
                        Tarif.Life.FrequencyExpense),
              premiumFrequency = c(1, 2, 4, 12)),
  age = 40, policyDuration = 20,
  sumInsured = 100000,
  contractClosing = as.Date("2020-09-01")
) %>% kableTable
tarif
premiumFrequency
1 2 4 12
Term life (frequency loading) 593.6832 300.5479 151.2039 50.69124
Term life (k-th yearly, approx. 1.Ord.) 593.6832 297.5740 148.9706 49.69770
Term life (k-th yearly, approx. 2.Ord.) 593.6832 297.5735 148.9702 49.69759
Term life (k-th yearly, exact) 593.6832 297.5735 148.9702 49.69759
Term life (modified gamma costs) 593.6832 303.3244 154.4408 52.29120

6.2 Security loadings

Although most mortality tables and expense loadings already have a certain amount of security margins included, often a tariff (mostly protection products) adds an additional security loading directly to the net present value of the benedits.

This can be easily implemented using the parameter security:

contractGridPremium(
  axes = list(age = seq(30, 60, 10), security = 10*(0:5)/100),
  tarif = Tarif.Life,
  policyDuration = 20,
  sumInsured = 100000,
  contractClosing = as.Date("2020-09-01")
) %>% kableTable(digits = 2)
age
security
0 0.1 0.2 0.3 0.4 0.5
30 301.74 319.41 337.08 354.75 372.42 390.09
40 593.68 640.54 687.39 734.24 781.09 827.95
50 1217.61 1326.83 1436.05 1545.27 1654.48 1763.70
60 2848.94 3121.23 3393.52 3665.81 3938.10 4210.39

7 Creating premium and contract grids

When developing a new product or comparing different products, it is often required to create tables of premiums or reserves for a product/tarif where just some of the parameters (like age, sum insured or maturity) change.

For this purpose, this package provides two functions to create two- or higher-dimensional grids of contracts with each dimension representing one of the parameters varying.

The grid is defined by the axes argument to the contractGrid() call. This is a named list giving all parameters that should vary inside the grid. Any of the parameters of the InsuranceContract$new() constructor can be used in the axes.

For example, one can compare multiple tariffs or multiple varying pararameters.

Let us look at the pure endowment above, which we implemented as a single-premium variant and a variant with regular premiums, both of which have a potential (partial or full) premium refund in case of death. How do the premiums of these contracts compare and how do the premiums depend on the premium refund proportion?

grd = contractGridPremium(
  axes = list(tarif = c(Tarif.PureEnd, Tarif.Endowment, Tarif.PureEnd.SP), premiumRefund = c(0, 0.5, 1)),
  age = 50, policyPeriod = 20,
  sumInsured = 10000,
  contractClosing = as.Date("2020-09-01")
)
grd
tarif
premiumRefund
0 0.5 1
Example Tariff - Pure Endowment 511.8570 539.9719 571.4267
Example Tariff - Endowment 597.8348 630.7702 667.6181
Example Tariff - Pure Endowment (SP) 9062.9952 9792.9840 10651.0296

The default implementation of contractGridPremium returns the written premium, but one can also choose other types of premiums to display, or even other contract values (like reserves).

If one needs to investigate multiple values, it is better to first create a grid of insurance contract objects and store it, so that the call to contractGridPremium does not have to re-calculate the same contracts over and over again, extract just one premium and discard the whole contract.

grd = contractGrid(
  axes = list(tarif = c(Tarif.PureEnd, Tarif.Endowment, Tarif.PureEnd.SP), premiumRefund = c(0, 0.5, 1)),
  age = 50, policyPeriod = 20,
  sumInsured = 10000,
  contractClosing = as.Date("2020-09-01")
)
# Compare net premiums without loadings:
contractGridPremium(grd, premium = "net")
tarif
premiumRefund
0 0.5 1
Example Tariff - Pure Endowment 426.7909 451.2802 478.6787
Example Tariff - Endowment 501.6814 530.3695 562.4656
Example Tariff - Pure Endowment (SP) 7739.6750 8378.4152 9129.2051
# Compare premium sums over the whole contract period (all contracts have the same sumInsured)
contractGridPremium(grd, .fun = function(c) {with(c$Values, 
     unitPremiumSum * premiums["written"])
})
tarif
premiumRefund
0 0.5 1
Example Tariff - Pure Endowment 10237.14 10799.44 11428.53
Example Tariff - Endowment 11956.70 12615.40 13352.36
Example Tariff - Pure Endowment (SP) 9063.00 9792.98 10651.03
# Compare risk premiums at time t=10 (the 11th row of the premium decomposition)
contractGridPremium(grd, .fun = function(c) {c$Values$premiumComposition[11, "risk"]})
tarif
premiumRefund
0 0.5 1
Example Tariff - Pure Endowment -37.58 -17.98 3.96
Example Tariff - Endowment 35.11 58.07 83.76
Example Tariff - Pure Endowment (SP) -64.75 -32.81 4.74
# Compare present value of all benefits and refunds (without costs) at time t=0
contractGridPremium(grd, .fun = function(c) {c$Values$absPresentValues[1, "benefitsAndRefund"]})
tarif
premiumRefund
0 0.5 1
Example Tariff - Pure Endowment 7739.67 8183.78 8680.64
Example Tariff - Endowment 9097.78 9618.03 10200.08
Example Tariff - Pure Endowment (SP) 7739.67 8378.42 9129.21

Other useful examples of grid comparisons include e.g. the effect of the interest rate and the mortality table on the premiums:

grd = contractGridPremium(
  axes = list(mortalityTable = mort.AT.census["m", -(1:10)], i = c(0, 0.005, 0.01), age = c(30, 45, 60), policyPeriod = c(10, 20)),
  tarif = Tarif.Life,
  contractClosing = as.Date("2020-09-01"),
  sumInsured = 10000
)
grd
mortalityTable
i
0 0.005 0.01
ÖVSt 1990/92 M 40.30 40.20 40.09
ÖVSt 2000/02 M 34.96 34.88 34.80
ÖVSt 2010/2012 M 31.77 31.71 31.66
mortalityTable
i
0 0.005 0.01
ÖVSt 1990/92 M 53.07 52.58 52.11
ÖVSt 2000/02 M 45.12 44.74 44.37
ÖVSt 2010/2012 M 38.72 38.46 38.21
mortalityTable
i
0 0.005 0.01
ÖVSt 1990/92 M 89.76 89.27 88.79
ÖVSt 2000/02 M 76.96 76.53 76.11
ÖVSt 2010/2012 M 63.17 62.83 62.50
mortalityTable
i
0 0.005 0.01
ÖVSt 1990/92 M 139.45 137.45 135.48
ÖVSt 2000/02 M 111.57 110.15 108.76
ÖVSt 2010/2012 M 98.07 96.70 95.36
mortalityTable
i
0 0.005 0.01
ÖVSt 1990/92 M 288.97 287.00 285.06
ÖVSt 2000/02 M 218.10 216.59 215.10
ÖVSt 2010/2012 M 191.56 190.38 189.23
mortalityTable
i
0 0.005 0.01
ÖVSt 1990/92 M 440.61 433.80 427.15
ÖVSt 2000/02 M 351.92 346.15 340.51
ÖVSt 2010/2012 M 291.32 286.96 282.70

8 Exporting contract data to Excel

The LifeInsuranceContracts package also provides a function to export a given contract to a spreadsheet in Excel format:

This function takes the contract and exports all data.frames in the contract’s contract$Values data list as separate tabs to a spreadsheet file. It also adds some nice formatting and additional markup. For contracts with multiple contract blocks (e.g. dynamic increases / sum increases or riders), the main contract and all its child blocks are exported as well.

The tab containing the premiums and the premium calculation coefficients even include the formulas, so one can in theory play around with the parameters to see how the premium changes.

If the contract has profit participation features and some profit scenarios have been added, they are exported as well.

Notice, however, that the Excel export is in general a static file containing the current state of the contract and all its values (cash flows, present values, premiums, reserves, profit participation, etc.) as well as the most important parameters and an overview of the history of the contract.

contract.exportExample = contract.PureEnd.NoRefund$clone()$
  addDynamics(t = 3, SumInsuredDelta = 10000)$
  addDynamics(t = 5, SumInsuredDelta = 15000)$
  addDynamics(t = 10, SumInsuredDelta = 15000)$
  addDynamics(t = 14, SumInsuredDelta = 10000)
exportInsuranceContract.xlsx(contract.exportExample, filename = "Example_PureEndowment_Dynamics.xlsx")

9 Creating examples for the Austrian Financial Market Authority

When introducing a new tariff, an Austrian insurance company has to submit a detailled mathematical description (so-called “Versicherungsmathematische Grundlagen”) of the tariff to the Financial Market Authority (FMA), which have to follow the regulation on actuarial bases for life insurance – LV-VMGV. The sections and contents of this document are strictly defined in the regulation, and in addition to the formulas of the tariff, an example contract has to be calculated with the following key parameters:

Given a tariff and a derived contract (with the above key parameters), this package provides two functions to calculate and print / export the required values either to the console / screen or to a file:

The function showVmGlgExamples calculates all required values for the actuarial bases document in the required order (including values after a premium waiver at the given time). If a filename is given, the output is exported to that text file, otherwise it is simply printed out in the R console:

VMGL.contract = InsuranceContract$new(
    Tarif.PureEnd,
    age = 35, policyPeriod = 30, 
    premiumFrequency = 1,
    sumInsured = 100000,
    contractClosing = as.Date("2020-07-01")
  )

showVmGlgExamples(VMGL.contract)
#> Tarif: Example Tariff - Pure Endowment
#> A pure endowment with regular premiums (standard tariff)
#> Typ: pureendowment
#> VS: 100000.00
#> Alter: 35, LZ: 30, Prämienzahlung: 30, Aufschubzeit: 0, Garantiezeit: 0
#> Rechenzins: 0%, Sterbetafel: ÖVSt 2010/2012 U
#> 
#> Prämien:
#> ========
#> Nettoprämie:          3101.31
#> Zillmerprämie:        3198.88
#> Bruttoprämie:         3534.13
#> Vorgeschr.Pr.:        3685.90
#> 
#> Sparprämie (t=10):    3190.01
#> Risikoprämie (t=10):     8.87
#> 
#> Reserven:
#> =========
#> Prämienpflichtig (t=10):             30052.86
#> Pr.Frei (mangels Zahlung) (tprf=12): 24635.70
#> VwKostenreserve (t=10):                 -0.00
#> VwKostenreserve (Pr.Frei) (tprf=12):   496.91
#> 
#> Bilanzreserve (t=10.50):             31730.97
#> Prämienübertrag (BM= 7):              1772.07
#> 
#> Rückkauf und Prämienfreistellung:
#> =================================
#> Rückkaufsreserve (t=10):          30052.86
#> Rückkaufswert (t=10):             28049.33
#> Abschlusskostenrücktrag (t=10):       0.00
#> 
#> Rückkaufswert (Prf.) (t=12):      25132.61 (VS: 29726.54)
#> 
#> Prämienfreie VS (t=10):           29726.54

The exportInsuranceContractExample provides no new functionality, but combines the Excel export feature and the regulatory example together. For a given contract it will create three files:

One can give a base name and an extra name to distinguish different calculations in the file names.

10 Handling contracts with increases

While many insurance contracts have a fixed sum insured and constant premium, many contracts include some kind of adjustment to account for inflation. There are various ways to achieve such an adjustment:

The LifeInsuranceContract package provides functionality for each of these increases. All three increases can in theory be combined in the same contract, although in practice this usually does not happen and at most one kind of increase is included in a contract

10.1 Fixed yearly premium increases

With this kind of increases, the initial contract valuation (i.e. the determination of the premium at contract inception) already takes into account that the premium will not stay constant over the whole period, but increases by a constant factor each year. The sum insured is calculated by the equivalence principle so that the expected present value of all future benefits and costs equals the expected present value of all future (i.e.  increasing) premium payments.

This type of yearly premium increase by a fixed factor can be implemented by the parameter:

In the following example, we create a 10-year endowment contract with constant premiums over the whole period and another one with idential parameters except that the premium increases by 4% each year:

# For comparison: Contract with constant premiums
contract.Endow.Constant = InsuranceContract$new(
  tarif = Tarif.Endowment,
  sumInsured = 10000,
  age = 50, policyPeriod = 10,
  contractClosing = as.Date("2020-09-01")
)
# Contract with 4% yearly premium increase and same sum insured
contract.Endow.PremInc = InsuranceContract$new(
  tarif = Tarif.Endowment,
  sumInsured = 10000,
  premiumIncrease = 1.04,
  age = 50, policyPeriod = 10,
  contractClosing = as.Date("2020-09-01")
)
premium.comparison = data.frame(
  `Sum Insured` = contract.Endow.Constant$Values$basicData[,"SumInsured"],
  `Constant Premium` = contract.Endow.Constant$Values$basicData[,"Premiums"],
  `4% Yearly Increase` = contract.Endow.PremInc$Values$basicData[,"Premiums"],
  check.names = F
  )
premium.comparison %>% pander
  Sum Insured Constant Premium 4% Yearly Increase
0 10000 1101 911.66
1 10000 1101 948.13
2 10000 1101 986.05
3 10000 1101 1025.50
4 10000 1101 1066.52
5 10000 1101 1109.18
6 10000 1101 1153.54
7 10000 1101 1199.68
8 10000 1101 1247.67
9 10000 1101 1297.58
10 10000 0 0.00

10.2 Fixed yearly benefit increases with constant premium

With this kind of increases, the premium will stay constant over the whole contract maturity, but the death and/or survival benefit (or the annuity payment) will increase by a fixed factor each year. This is typically to safeguard the benefit against inflation, so that the value of the annuity payment or death benefit does not diminish due to inflation. The initial contract valuation (i.e. the determination of the constant premium at contract inception) already takes into account that the benefits will not stay constant over the whole period, but increases by a constant factor each year.

This type of yearly benefit increase by a fixed factor can be implemented by the parameters:

In the following example, we create a 10-year endowment contract with constant premiums over the whole period and another one with idential parameters except that the premium increases by 4% each year:

# For comparison: Contract with constant premiums
contract.TermLife.Constant = InsuranceContract$new(
  tarif = Tarif.Life,
  sumInsured = 10000,
  age = 50, policyPeriod = 10,
  contractClosing = as.Date("2020-09-01")
)
# Contract with 4% yearly increase in sum insured (final survival benefit is 10.000)
contract.TermLife.SumInc = InsuranceContract$new(
  tarif = Tarif.Life,
  sumInsured = 10000,
  deathBenefit = (1.04)^(0:20),
  age = 50, policyPeriod = 10,
  contractClosing = as.Date("2020-09-01")
)
premium.comparison = data.frame(
  `Const S.I.` = contract.TermLife.Constant$Values$absCashFlows[,"death"],
  `Const. Premium` = contract.TermLife.Constant$Values$absCashFlows[,"premiums_advance"],
  `4% sum increase` = contract.TermLife.SumInc$Values$absCashFlows[,"death"],
  `Premium w. sum increase` = contract.TermLife.SumInc$Values$absCashFlows[,"premiums_advance"],
  check.names = F
  )
premium.comparison
Const S.I. Const. Premium 4% sum increase Premium w. sum increase
10000 61 10000.00 74.91
10000 61 10400.00 74.91
10000 61 10816.00 74.91
10000 61 11248.64 74.91
10000 61 11698.59 74.91
10000 61 12166.53 74.91
10000 61 12653.19 74.91
10000 61 13159.32 74.91
10000 61 13685.69 74.91
10000 61 14233.12 74.91
0 0 0.00 0.00

For annuities, the benefit increase is not handled through deathBenefits, but rather through the parameter

In the following example, we create a 10-year endowment contract with constant premiums over the whole period and another one with idential parameters except that the premium increases by 4% each year:

# For comparison: Contract with constant annuity
contract.Annuity.Constant = InsuranceContract$new(
  tarif = Tarif.DefAnnuity,
  sumInsured = 1200,
  age = 55, 
  policyPeriod = 10,
  deferralPeriod = 5,
  premiumPeriod = 5,
  contractClosing = as.Date("2020-09-01")
)
# Contract with 4% yearly increase in annuity benefits
contract.Annuity.Increasing = InsuranceContract$new(
  tarif = Tarif.DefAnnuity,
  sumInsured = 1200,
  annuityIncrease = 1.04,
  age = 55, 
  policyPeriod = 10,
  deferralPeriod = 5,
  premiumPeriod = 5,
  contractClosing = as.Date("2020-09-01")
)
# Contract with 4% yearly increase in premiums and in annuity payments
contract.Annuity.IncreasingBoth = InsuranceContract$new(
  tarif = Tarif.DefAnnuity,
  sumInsured = 1200,
  annuityIncrease = 1.04,
  premiumIncrease = 1.04,
  age = 55, 
  policyPeriod = 10,
  deferralPeriod = 5,
  premiumPeriod = 5,
  contractClosing = as.Date("2020-09-01")
)
premium.comparison = data.frame(
  `Const. Annuity` = contract.Annuity.Constant$Values$absCashFlows[,"survival_advance"],
  `Const. Premium` = contract.Annuity.Constant$Values$absCashFlows[,"premiums_advance"],
  `4% Annuity Increase` = contract.Annuity.Increasing$Values$absCashFlows[,"survival_advance"],
  `Premium w. Ann.Increase` = contract.Annuity.Increasing$Values$absCashFlows[,"premiums_advance"],
  `Inc.Premium w. Ann.Increase` = contract.Annuity.IncreasingBoth$Values$absCashFlows[,"premiums_advance"],
  check.names = F
  )
premium.comparison %>% pander
Const. Annuity Const. Premium 4% Annuity Increase Premium w. Ann.Increase Inc.Premium w. Ann.Increase
0 1276.15 0.00 1381.65 1270.82
0 1276.15 0.00 1381.65 1321.65
0 1276.15 0.00 1381.65 1374.52
0 1276.15 0.00 1381.65 1429.50
0 1276.15 0.00 1381.65 1486.68
1200 0.00 1200.00 0.00 0.00
1200 0.00 1248.00 0.00 0.00
1200 0.00 1297.92 0.00 0.00
1200 0.00 1349.84 0.00 0.00
1200 0.00 1403.83 0.00 0.00
0 0.00 0.00 0.00 0.00

10.3 Dynamic Increases

With dynamic increases, the contract initially is written with a fixed sum insured and constant premiums over the whole contract period. The future increases are not considered at all.

After the initial contract inception, either yearly or when a consumer price index changes by a value larger than a given threshold, the sum insured is increased (either by a fixed amount or by an amount determined by the index change) and the premium is adjusted accordingly. Internally, the original contract is left untouched and the increase is modelled by a separate contract with the same key parameters, only with shorter duration and a sum insured that represents only the increase. The premium for this increase is calculated like a separate contract with only the difference in the over-all sum insured as its sum insured.

Each dynamic increase then adds another separate tiny InsuranceContract object and the over-all values are the sums of all those contract blocks (sometimes also called “contract slices”).

The InsuranceContract class provides a method to add a dynamic increase:

Only one of NewSumInsured (new total sum insured) and SumInsuredDelta (only the difference between old and new sum insured) is needed. This method adds a new contract block to the given InsuranceContract, starting at time \(t\) with SumInsuredDelta as its sum insured and its premium calculated from the shorter contract period and the sum insured delta. These blocks for dynamic increases are stored in the contract’s $blocks list of children. The values stored in the contract are then simply the sum of all its children.

Here is an example of a 10-year endowment, which has dynamic increases at times \(t=5\), \(t=7\) and \(t=8\):

# For comparison: Contract with constant annuity
contract.Endowment.Dynamics = InsuranceContract$new(
  tarif = Tarif.Endowment,
  sumInsured = 10000,
  age = 40, 
  policyPeriod = 10,
  contractClosing = as.Date("2020-09-01"),
  id = "Initial contract"
)$
  addDynamics(t = 5, NewSumInsured = 11000, id = "Dynamic at 5")$
  addDynamics(t = 7, NewSumInsured = 12000, id = "Dynamic at 7")$
  addDynamics(t = 8, NewSumInsured = 13500, id = "Dynamic at 8")

# Over-all contract sum insured and premiums for all blocks combined
contract.Endowment.Dynamics$Values$basicData[,c("SumInsured", "Premiums")] %>% pander
  SumInsured Premiums
0 10000 1087.88
1 10000 1087.88
2 10000 1087.88
3 10000 1087.88
4 10000 1087.88
5 11000 1306.43
6 11000 1306.43
7 12000 1671.09
8 13500 2491.84
9 13500 2491.84
10 13500 0.00
Sum Insured for the over-all contract and each of the blocks
t Over-all contract Initial contract Dynamic at 5 Dynamic at 7 Dynamic at 8
0 10000 10000 0 0 0
1 10000 10000 0 0 0
2 10000 10000 0 0 0
3 10000 10000 0 0 0
4 10000 10000 0 0 0
5 11000 10000 1000 0 0
6 11000 10000 1000 0 0
7 12000 10000 1000 1000 0
8 13500 10000 1000 1000 1500
9 13500 10000 1000 1000 1500
10 13500 10000 1000 1000 1500
Premium time series for the over-all contract and each of the blocks
t Over-all contract Initial contract Dynamic at 5 Dynamic at 7 Dynamic at 8
0 1087.88 1087.88 0.00 0.00 0.00
1 1087.88 1087.88 0.00 0.00 0.00
2 1087.88 1087.88 0.00 0.00 0.00
3 1087.88 1087.88 0.00 0.00 0.00
4 1087.88 1087.88 0.00 0.00 0.00
5 1306.43 1087.88 218.55 0.00 0.00
6 1306.43 1087.88 218.55 0.00 0.00
7 1671.09 1087.88 218.55 364.66 0.00
8 2491.84 1087.88 218.55 364.66 820.75
9 2491.84 1087.88 218.55 364.66 820.75
10 0.00 0.00 0.00 0.00 0.00

11 Profit participation

In addition to the above guaranteed values, many contracts also include some kind of profit sharing. The total amount of money to be distributed is usually predetermined by law or regulation (in Austria by the “Lebensversicherung-Gewinnbeteiligungsverordnung – LV-GBV”, but the actual way they are distributed to individual contracts is up the insurance undertaking. The profit participation scheme defines profit participation allocations based on certain rates and bases, where the formulas and the types of profit are pre-determined in a formal document (which in this package will be implemented as an object of class ProfitParticipation), while the profit rates are determined by the management of the undertaking (“discretionary benefits”).

Typical Austrian insurance contracts have one of two kinds of profit sharing mechanisms:

11.1 Advance profit participation (premium rebate)

To implement advance profit participation, one still needs to create a ProfitParticipation object, which can be empty. The contract parameters advanceProfitParticipation and advanceProfitParticipationInclUnitCost then define the premium rebate. They can be set either in the profit scheme or in the tariff definition. The latter is usually the easier way, as one profit scheme might be applicable to multiple different tariffs with different advance profit participation rates.

As an example, we will use our Tarif.Life whole life tarif defined above and add a \(38\%\) advance profit participation on the premium:

profit.Advance.V1 = ProfitParticipation$new(
    name = "Profit Scheme for advance profit participation, V 1.0",
    advanceProfitParticipation = 0.38
);

Tarif.Life.withPP = Tarif.Life$createModification(
  name = "Example Tariff - Whole/Term Life with profit sharing",
  tarif = "Life1PP",
  profitParticipationScheme = profit.Advance.V1
)

contract.LifePP = InsuranceContract$new(
  tarif = Tarif.Life.withPP,
  age = 40, policyPeriod = 10,
  sumInsured = 100000,
  contractClosing = as.Date("2019-09-01")
)

The premium composition shows that the profit participation

contract.LifePP$Values$premiumComposition
t charged tax unitcosts profit.advance gross net
0 194.94 7.5 10 -108.75 286.19 160.11
1 194.94 7.5 10 -108.75 286.19 160.11
2 194.94 7.5 10 -108.75 286.19 160.11
3 194.94 7.5 10 -108.75 286.19 160.11
4 194.94 7.5 10 -108.75 286.19 160.11
5 194.94 7.5 10 -108.75 286.19 160.11
6 194.94 7.5 10 -108.75 286.19 160.11
7 194.94 7.5 10 -108.75 286.19 160.11
8 194.94 7.5 10 -108.75 286.19 160.11
9 194.94 7.5 10 -108.75 286.19 160.11
10 0.00 0.0 0 0.00 0.00 160.11

11.2 The ProfitParticiption class

The profit participation scheme of a tarif is represented by an object of the ProfitParticipation class. While the InsuranceContract.Parameters list contains elements for the profit rates, the implementation of the calculation of the profit parts is done by functions defined in the ProfitParticipation constructor.

This scheme is passed to the InsuranceTarif or InsuranceContract via the profitParticipationScheme parameter. `

There are different types of profit participation assignments, based on the type of risks they are based upon:

Each of these profit components in general depends in some way on a profit rate and a basis to which the rate is applied. So each component has the general functional form: \[Profit^{type}_t = Calc\left(Rate^{type}_t, Basis^{type}_t\right)\] The most common calculation function is a simple multiplication, i.e. \(Calc(r, b) = r\cdot b\), but other functions are possible, to

The (default) parameters that can be passed to the ProfitParticipation constructor are:

General profit setup
waitingPeriod During the waiting period at the beginning of a contract, no profit participation is assigned
profitComponents describes the different components of profit participation (“interest”, “risk”, “expense”, “sum”, “terminal”)
profitClass a profit ID used to identify the correct profit rates (rates are defined per profit class)
profitRates a data frame containing company-wide profit rates. Key columns are year and profitClass
Advance profit participation rates
advanceProfitParticipation premium rebate (percentage discount on the gross premium)
advanceProfitParticipationInclUnitCost premium rebate (percentage discount on the gross premium including unit costs)
Regular profit participation rates
guaranteedInterest \(i\) Contract-specific override of the guaranteed intereste rate (only for profit participation purposes)
interestProfitRate \(ip_t\) Profit interest rate (added to the guaranteed interest rate to arrive at the total credited rate)
totalInterest \(tcr_t\) The total credited interest rate (sum of guaranteed interest and profit participation interest)
mortalityProfitRate \(rp_t\) Mortality / risk profit rate
expenseProfitRate \(ep_t\) Expenso profit rate
sumProfitRate \(sp_t\) Sum profit rate (typically a function, depending on sum insured)
terminalBonusRate \(tb_t\) Terminal bonus rate
terminalBonusFundRate \(tbf_t\) Terminal bonus fund rate, i.e. which percentage of the assigned profits are withheld in a separate terminal bonus fund and only paid out at maturity.

For the calculation of the profit participation, the ProfitParticipation class holds a list of function pointers to calculate each component of profit participation, as outlined above. For each of interest, risk, expense, sum, terminal and terminal bonus fund the following three functions can be given:

Thus, the constructor of the ProfitParticipation class also takes the following parameters:

Type of profit Function for rate Function for base Function for calculation
interest on accrued profit getInterestOnProfits - (existing profit) -
interest profit getInterestProfitRate getInterestProfitBase calculateInterestProfit
risk profit getRiskProfitRate getRiskProfitBase calculateRiskProfit
expense profit getExpenseProfitRate getExpenseProfitBase calculateExpenseProfit
sum profit getSumProfitRate getSumProfitBase calculateSumProfit
terminal bonus getTerminalBonusRate getTerminalBonusBase calculateTerminalBonus
terminal bonus fund getTerminalBonusFundRate getTerminalBonusFundBase calculateTerminalBonusFund

In addition, the following parameters define functions for reserves:

To calculate the actual benefits paid out from profit participation, the following parameters take the corresponding functions (signature: function(profits, rates, params, values, ...) )

calculateSurvivalBenefit Benefit from profit participation at maturity (in addition to the guaranteed payout)
calculateDeathBenefitAccrued Benefit from profit participation upon death (in addition to the guaranteed payout)
calculateDeathBenefitTerminal Benefit from terminal bonus upon death (in addition to the guaranteed payout and regular profit participation)
calculateSurrenderBenefitAccrued Benefit from profit participation upon contract surrender (in addition to the surrender value)
calculateSurrenderBenefitTerminal Benefit from terminal bonus upon contract surrender (in addition to the surrender value and regular profit participation)
calculatePremiumWaiverBenefitAccrued Benefit from profit participation upon premium waiver (in addition to the surrender value)
calculatePremiumWaiverBenefitTerminal Benefit from terminal bonus upon premium waiver surrender (in addition to the surrender value and regular profit participation)

11.2.1 Existing functions to use

While the details of a profit participation scheme are very specific and no two profit schemes are exactly alike, the basic functionality to extract rates and bases and the calculation functions are usually not so different. For this reason, the LifeInsuranceContracts package provides several little helper functions that provide the most common functionality for the definition of rates, bases and the profit calculation. See ?ProfitParticipationFunctions for the full list.

The most common functions are:

  • PP.base.PreviousZillmerReserve(rates, params, values, ...)

  • PP.base.contractualReserve(rates, params, values, ...)

  • PP.base.previousContractualReserve(rates, params, values, ...)

  • PP.base.meanContractualReserve(rates, params, values, ...)

  • PP.base.ZillmerRiskPremium(rates, params, values, ...)

  • PP.base.sumInsured(rates, params, values, ...)

  • PP.base.totalProfitAssignment(res, ...)

  • PP.rate.interestProfit(rates, ...)

  • PP.rate.riskProfit(rates, ...)

  • PP.rate.expenseProfit(rates, ...)

  • PP.rate.sumProfit(rates, ...)

  • PP.rate.terminalBonus(rates, ...)

  • PP.rate.terminalBonusFund(rates, ...)

  • PP.rate.interestProfitPlusGuarantee(rates, ...)

  • PP.rate.totalInterest(rates, ...)

  • PP.calculate.RateOnBase(base, rate, waiting, rates, params, values, ...)

  • PP.calculate.RateOnBaseMin0(base, rate, waiting, rates, params, values, ...)

  • PP.calculate.RatePlusGuaranteeOnBase(base, rate, waiting, rates, params, values, ...)

  • PP.benefit.ProfitPlusTerminalBonusReserve(profits, ...)

  • PP.benefit.Profit(profits, ...)

  • PP.benefit.ProfitPlusGuaranteedInterest(profits, rates, ...)

  • PP.benefit.ProfitPlusTotalInterest(profits, rates, params, values)

  • PP.benefit.ProfitPlusHalfTotalInterest(profits, ...)

  • PP.benefit.ProfitPlusInterestMinGuaranteeTotal(profits, rates, ...)

  • PP.benefit.TerminalBonus5YearsProRata(profits, params, ...)

  • PP.benefit.TerminalBonus5Years(profits, params, ...)

  • PP.benefit.TerminalBonus(profits, params, ...)

11.2.2 Example profit scheme

For example, imagine a tariff’s total cumulated assigned profit \(G_t\) and the benefits at time \(t\) have the formulas: \[Prof_t = \left(G_{t-1} + TBF_{t-1}\right) \cdot \left(1 + i + ip_t\right) + ip_t \cdot \frac{\left(Res_{t-1} + Res_{t}\right)}{2} + rp_t \cdot P^r_t + ep_t \cdot SumInsured + sp_t(SI) \cdot SumInsured\] \[G_t = G_{t-1} + (1 - tbf_t) \cdot Prof_t\] \[TBF_t = TBF_{t-1} + tbf_t \cdot Prof_t\] \[Death_t = G_t \cdot \left(1 + i + ip_t\right) + TBF_t\] \[Matu_n = G_n + TBF_n\] \[Surrender_t = G_t\cdot \left(1+\frac{i + ip_t}{2}\right) + 0.5 \cdot TBF_t\] \[Red_t = G_t + 0.5 \cdot TBF_t\]

These formulas can be interpreted as following:

  • There are multiple profit components: interest profit, risk profit, expense profit and sum profit.
  • The total profit assignment \(Prof_t\) in year \(t\) consists of:
    • Interest (guarantee + interest profit rate) on the accrued profits and the terminal bonus fund
    • Interest profit on the average reserve
    • Risk profit as part of the risk premium (similar to advance profit participation, but on a year-by-year basis on the actual risk premium)
    • Expense profit relative to the sum insured
    • Sum profit relative to the sum insured. The rate depends on the sum insured, too (e.g. higher SI typically have higher sum profit)
    • Only a portion \((1-tbf_t)\) is added to the accrued bonus, while the rest ist stored in the Terminal Bonus Fund.
  • The existing cumulated profit \(G_{t-1}\) and the terminal bonus fund \(TBF_{t-1}\) yields interest with the guaranteed interest rate plus potentially the interest profit rate. If the total credited rate is lower than the guarantee, the guarantee is still applied to the existing profits. => PP.rate.interestProfitPlusGuarantee
  • Additionaly, interest profit is assigned with rate \(ip_t\) (=0 if total credited rate is below guarantee) multiplied with the average of the current and the previous reserve for the guaranteed part. => PP.base.meanContractualReserve
  • The risk profit works similar to advance profit participation, only that part of the (actual) risk premium of the year is returned to the customer after having paid it. => PP.base.ZillmerRiskPremium
  • Expense profit is based on the sum insured, since most cost structures are linear in the sum insured and contain certain loadings, which are returned to the customer via this profit component.
  • A sum profit of \(sp_t\) of the sum insured is added, even if no interest profit is distributed. The sum profit rate depends on the sum insured (as a function), since the charges expenses increase linearly in the sum insured while the actual cost do increase only sub-linear. So for higher sums typically more expenses are returned. => The sum profit rate will be a function rather than a single value each year.
  • Only a part \((1-tbf_t)\) of the profit assignment in year \(t\) is added to the accrued profits \(G_t\), while the rest \(tbf_t\) is stored in the terminal bonus fund \(TBF_t\), which is partially lost on surrender or premium waiver.

The values of \(Res_t\), \(P^r_t\), \(SumInsured\) and the guaranteed interest \(i^g_t\) are prescribed by the tariff or contract, while the profit participation rates \(ip_t\), \(rp_t\), \(ep_t\) and \(sp_t\) are decided on a year-by-year basis by the management boards.

The benefits for death, maturity, surrender and premium waivers are:

  • In case of death, the existing cumulated profits yield one additional year of interest => PP.benefit.ProfitPlusInterestMinGuaranteeTotal
  • At maturity of the contract, the existing cumulated profits are paid out in addition to the guaranteed benefits of the contract. => PP.benefit.Profit
  • In case of surrender (on average half a year after the contract’s anniversary), half a year of interest is added to the existing cumulated profits from the last anniversary => PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal
  • When premiums are waived, the existing accrued profits are taken into account without any additional interest. => PP.benefit.Profit
  • The terminal bonus fund is paid out fully on death and at maturity, while half of the TBF is lost on surrender or premium waiver.

This profit scheme can be easily be implemented as a ProfitParticipation object, where one can pass the functions for bases and calculation and also provide default profit rates:

ProfitScheme.example = ProfitParticipation$new(
  name = "Example Profit Scheme, V 1.0",
  profitComponents = c("interest", "risk", "expense", "sum", "TBF"),

  getInterestOnProfits    = PP.rate.interestProfitPlusGuarantee,
  getInterestProfitBase   = PP.base.meanContractualReserve,
  getRiskProfitBase       = PP.base.ZillmerRiskPremium,
  getExpenseProfitBase    = PP.base.sumInsured,
  getSumProfitBase        = PP.base.sumInsured,
  getTerminalBonusFundBase = PP.base.totalProfitAssignment,
  
  mortalityProfitRate = 0.15,
  expenseProfitRate = 0.01,
  sumProfitRate = function(params, ...) {if (params$ContractData$sumInsured > 1000000) 0.005 else 0;},
  terminalBonusFundRate = 0.3,
  
  calculateSurvivalBenefit      = PP.benefit.ProfitPlusTerminalBonusReserve,
  
  calculateDeathBenefitAccrued  = PP.benefit.ProfitPlusInterestMinGuaranteeTotal,
  calculateDeathBenefitTerminal = PP.benefit.TerminalBonus,
  calculateSurrenderBenefitAccrued = PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal,
  calculateSurrenderBenefitTerminal = function(profits, ...) {  profits[, "TBF"] / 2 },
  calculatePremiumWaiverBenefitAccrued = PP.benefit.Profit,
  calculatePremiumWaiverBenefitTerminal = function(profits, ...) {  profits[, "TBF"] / 2 },
  
  profitClass = NULL
)

The calculation functions are not given, as they default to the correct PP.calculate.RateOnBase anyway. The interest profit rates are not given, as they will vary over time with no default value. Rathery, they need to be passed to the call to InsuranceContract$addProfitScenario() to calculate one particular profit scenario with given rates. In contrast, the mortality, expense and sum profit rates are initialized with some default values, which will be used if a profit scenario does not explicitly give those profit rates.

11.2.3 Using the profit scheme in a tariff or contract

The profit scheme defined above can now be used with the profitParticipationScheme parameter in a tariff or a contract. Usually, the profit scheme is a property of the product, so it should be specified in the tariff, but can be overridden in a contract.

As an example, let us create an endowment contract with 500% death benefit that uses this profit scheme:

contract.Endow.PP = InsuranceContract$new(
  tarif = Tarif.Endowment,
  sumInsured = 10000,
  deathBenefitProportion = 5,
  age = 50, policyPeriod = 15,
  
  profitParticipationScheme = ProfitScheme.example,
  contractClosing = as.Date("2020-09-01")
)

In contrast to the guaranteed values, which can and will be calculated as soon as the contract is created, the profit participation needs to be explicitly called with the desired rates. A contract can store multiple different profit scenarios, which can be added with the addProfitScenario() method. This method can also be chained to add multiple scenarios (e.g. )

contract.Endow.PP$
  addProfitScenario(id = "Current total credited rate", guaranteedInterest = 0.005, interestProfitRate = 0.02, totalInterest = 0.025)$
  addProfitScenario(id = "Current TCR-1%", guaranteedInterest = 0.005, interestProfitRate = 0.01, totalInterest = 0.015)$
  addProfitScenario(id = "Current TCR+1%", guaranteedInterest = 0.005, interestProfitRate = 0.03, totalInterest = 0.035)
  

All profit scenarios are stored in the InsuranceContract$Values$profitScenarios list indexed with the id given in the call.

The array containing all values of the profit scenario first holds the calculation basis and the rate for each of the profit components:

contract.Endow.PP$Values$profitScenarios$`Current total credited rate` %>%
  as.data.frame() %>%
  select(ends_with("Base"), ends_with("Interest"), ends_with("Rate"), -TBFRate, -TBFBase, -totalInterest) %>%
  rowid_to_column("t") %>% mutate(t = t - 1) %>% kable()
t interestBase riskBase expenseBase sumBase guaranteedInterest interestProfitRate riskProfitRate expenseProfitRate sumProfitRate interestOnProfitRate
0 0.00000 0.000000 10000 10000 0.000 0.00 0.00 0.00 0 0.000
1 50.61256 27.024462 10000 10000 0.005 0.02 0.15 0.01 0 0.025
2 708.96173 27.864594 10000 10000 0.005 0.02 0.15 0.01 0 0.025
3 1369.84584 28.530582 10000 10000 0.005 0.02 0.15 0.01 0 0.025
4 2033.47830 28.971176 10000 10000 0.005 0.02 0.15 0.01 0 0.025
5 2700.10951 29.166224 10000 10000 0.005 0.02 0.15 0.01 0 0.025
6 3370.01999 29.078427 10000 10000 0.005 0.02 0.15 0.01 0 0.025
7 4043.52669 28.675342 10000 10000 0.005 0.02 0.15 0.01 0 0.025
8 4721.02510 27.836281 10000 10000 0.005 0.02 0.15 0.01 0 0.025
9 5403.03273 26.443040 10000 10000 0.005 0.02 0.15 0.01 0 0.025
10 6090.18390 24.386537 10000 10000 0.005 0.02 0.15 0.01 0 0.025
11 6783.23933 21.530597 10000 10000 0.005 0.02 0.15 0.01 0 0.025
12 7483.09054 17.758669 10000 10000 0.005 0.02 0.15 0.01 0 0.025
13 8190.75138 12.952725 10000 10000 0.005 0.02 0.15 0.01 0 0.025
14 8907.32544 7.062333 10000 10000 0.005 0.02 0.15 0.01 0 0.025
15 9633.99111 0.000000 10000 10000 0.005 0.02 0.15 0.01 0 0.025

The base for interest profit is the average of the reserve:

t SumInsured Zillmer AvgZillmer
0 10000 -277.95 -138.98
1 10000 379.18 50.61
2 10000 1038.75 708.96
3 10000 1700.95 1369.85
4 10000 2366.01 2033.48
5 10000 3034.21 2700.11
6 10000 3705.83 3370.02
7 10000 4381.22 4043.53
8 10000 5060.83 4721.03
9 10000 5745.24 5403.03
10 10000 6435.13 6090.18
11 10000 7131.35 6783.24
12 10000 7834.83 7483.09
13 10000 8546.67 8190.75
14 10000 9267.98 8907.33
15 10000 10000.00 9633.99

From the bases and rates, the calculation function (in our case simply the multiplication of rate and base) is applied to arrive at the yearly profit allocation of each component:

contract.Endow.PP$Values$profitScenarios$`Current total credited rate` %>%
  as.data.frame() %>%
  select(ends_with("Profit"), totalProfitAssignment, -totalProfit) %>%
  rowid_to_column("t") %>% mutate(t = t - 1) %>%
  pander
t interestProfit riskProfit expenseProfit sumProfit componentsProfit interestOnProfit totalProfitAssignment
0 0.00 0.00 0 0 0.00 0.00 0.00
1 1.01 4.05 100 0 105.07 0.00 105.07
2 14.18 4.18 100 0 118.36 2.63 120.99
3 27.40 4.28 100 0 131.68 5.65 137.33
4 40.67 4.35 100 0 145.02 9.08 154.10
5 54.00 4.37 100 0 158.38 12.94 171.31
6 67.40 4.36 100 0 171.76 17.22 188.98
7 80.87 4.30 100 0 185.17 21.94 207.12
8 94.42 4.18 100 0 198.60 27.12 225.72
9 108.06 3.97 100 0 212.03 32.77 244.79
10 121.80 3.66 100 0 225.46 38.89 264.35
11 135.66 3.23 100 0 238.89 45.49 284.39
12 149.66 2.66 100 0 252.33 52.60 304.93
13 163.82 1.94 100 0 265.76 60.23 325.98
14 178.15 1.06 100 0 279.21 68.38 347.58
15 192.68 0.00 100 0 292.68 77.07 369.75

The totalProfitAssignment column is the sum of all component allocations in the given year (the \(Prof_t\) in the formulas above).

After all components are calculated, the yearly profit assignment is split into the part that is accrued in the regular bonus and the part that is placed in the terminal bonus fund, using the terminal bonus fund rate. Finally, the yearly regular and terminal bonus assignments can be summed up to the regular and the terminal bonus:

contract.Endow.PP$Values$profitScenarios$`Current total credited rate` %>%
  as.data.frame() %>%
  select(TBFBase, TBFRate, TBFBonusAssignment, regularBonusAssignment, TBF, regularBonus, totalProfit) %>%
  rowid_to_column("t") %>% mutate(t = t - 1) %>%
  pander
t TBFBase TBFRate TBFBonusAssignment regularBonusAssignment TBF regularBonus totalProfit
0 0.00 0.0 0.00 0.00 0.00 0.00 0.00
1 105.07 0.3 31.52 73.55 31.52 73.55 105.07
2 120.99 0.3 36.30 84.69 67.82 158.24 226.05
3 137.33 0.3 41.20 96.13 109.01 254.37 363.38
4 154.10 0.3 46.23 107.87 155.24 362.24 517.48
5 171.31 0.3 51.39 119.92 206.64 482.16 688.79
6 188.98 0.3 56.69 132.29 263.33 614.44 877.78
7 207.12 0.3 62.13 144.98 325.47 759.42 1084.89
8 225.72 0.3 67.72 158.00 393.18 917.43 1310.61
9 244.79 0.3 73.44 171.35 466.62 1088.78 1555.40
10 264.35 0.3 79.30 185.04 545.92 1273.82 1819.75
11 284.39 0.3 85.32 199.07 631.24 1472.90 2104.14
12 304.93 0.3 91.48 213.45 722.72 1686.35 2409.07
13 325.98 0.3 97.80 228.19 820.52 1914.54 2735.05
14 347.58 0.3 104.27 243.31 924.79 2157.84 3082.63
15 369.75 0.3 110.92 258.82 1035.71 2416.66 3452.38

The last step in the calculation of a scenario is to calculate the benefits for each of the possible types of payout:

contract.Endow.PP$Values$profitScenarios$`Current total credited rate` %>%
  as.data.frame() %>%
  select(survival, deathAccrued, death, surrenderAccrued, surrender, premiumWaiverAccrued, premiumWaiver) %>%
  rowid_to_column("t") %>% mutate(t = t - 1) %>%
  pander
t survival deathAccrued death surrenderAccrued surrender premiumWaiverAccrued premiumWaiver
0 0 0.00 0.00 0.00 0.00 0.00 0.00
1 0 73.91 73.91 73.73 89.49 73.55 89.31
2 0 159.03 159.03 158.63 192.54 158.24 192.14
3 0 255.64 255.64 255.00 309.51 254.37 308.87
4 0 364.05 364.05 363.14 440.76 362.24 439.86
5 0 484.57 484.57 483.36 586.68 482.16 585.47
6 0 617.51 617.51 615.98 747.64 614.44 746.11
7 0 763.22 763.22 761.32 924.06 759.42 922.16
8 0 922.01 922.01 919.72 1116.31 917.43 1114.02
9 0 1094.23 1094.23 1091.50 1324.81 1088.78 1322.09
10 0 1280.19 1280.19 1277.01 1549.97 1273.82 1546.79
11 0 1480.26 1480.26 1476.58 1792.20 1472.90 1788.52
12 0 1694.78 1694.78 1690.56 2051.92 1686.35 2047.71
13 0 1924.11 1924.11 1919.32 2329.58 1914.54 2324.79
14 0 2168.63 2168.63 2163.24 2625.63 2157.84 2620.24
15 0 2428.75 2428.75 2422.71 2940.56 2416.66 2934.52

One can add as many profit scenarios as desired. Each of the rates in the addProfitScenario-call can also be a vector giving the corresponding rate for each year of the contract:

contract.Endow.PP$
  addProfitScenario(id = "decreasing TCR", guaranteedInterest = 0.005, 
                    interestProfitRate = (15:0)/15 * 0.02, 
                    expenseProfitRate = c(rep(0.01, 5), rep(0.005, 5), rep(0, 6)))

contract.Endow.PP$Values$profitScenarios$`decreasing TCR` %>%
  as.data.frame() %>%
  select(interestBase, expenseBase, interestProfitRate, expenseProfitRate, interestOnProfitRate, interestProfit, expenseProfit, totalProfit) %>%
  rowid_to_column("t") %>% mutate(t = t - 1) %>%
  kable
t interestBase expenseBase interestProfitRate expenseProfitRate interestOnProfitRate interestProfit expenseProfit totalProfit
0 0.00000 10000 0.0000000 0.000 0.0000000 0.0000000 0 0.0000
1 50.61256 10000 0.0186667 0.010 0.0236667 0.9447677 100 104.9984
2 708.96173 10000 0.0173333 0.010 0.0223333 12.2886701 100 223.8118
3 1369.84584 10000 0.0160000 0.010 0.0210000 21.9175334 100 354.7089
4 2033.47830 10000 0.0146667 0.010 0.0196667 29.8243484 100 495.8549
5 2700.10951 10000 0.0133333 0.005 0.0183333 36.0014602 50 595.3220
6 3370.01999 10000 0.0120000 0.005 0.0170000 40.4402399 50 700.2444
7 4043.52669 10000 0.0106667 0.005 0.0156667 43.1309514 50 808.6472
8 4721.02510 10000 0.0093333 0.005 0.0143333 44.0629009 50 918.4761
9 5403.03273 10000 0.0080000 0.005 0.0130000 43.2242619 50 1027.6070
10 6090.18390 10000 0.0066667 0.000 0.0116667 40.6012260 0 1083.8550
11 6783.23933 10000 0.0053333 0.000 0.0103333 36.1772764 0 1134.4617
12 7483.09054 10000 0.0040000 0.000 0.0090000 29.9323621 0 1177.2680
13 8190.75138 10000 0.0026667 0.000 0.0076667 21.8420037 0 1210.0787
14 8907.32544 10000 0.0013333 0.000 0.0063333 11.8764339 0 1230.6783
15 9633.99111 10000 0.0000000 0.000 0.0050000 0.0000000 0 1236.8317

In the Excel export, a separate tab of the Excel file will hold all profit scenarios added to the contract.

12 Modifying the default calculation approach

While the cash-flow approach described above and based on the type parameter of the InsuranceTarif works very well for all standart types of life insurance, sometimes a tariff does not follow the standard behaviour exactly. The valuation approach with all-determining cash flows is still correct, but the cash flows might need to be adjusted. For this, some hook functions are provided that allow modification of the contract’s internals (e.g. cash flows) before all other calculations commence.

Two hooks are provided, which allow modifications of the cash flow profiles before present values, premiums and reserves are calculated:

adjustCashFlows Adjust the premium and benefit cash flows of the contract
adjustCashFlowsCosts Adjust the cost cash flows

The function signature is function(x, params, values, ...), where x is the object holding the standard cash flows determined for the contract. The return value of the hook function will be used instead of x.

An example where the cash-flow-approach solely based on type does not immediately work is a waiting period of 3 years for the death benefit. In particular, if a person dies during the first 3 years of the contract, no death benefit is paid out.

The easiest way to implement such cash flows is to let the InsuranceTarif first create the standard cash flows (with benefits during the first three years) and then provide a hook function that nullifies the benefits in the waiting period, before all present values, premiums and reserves are calculated.

contract.Endow.Waiting = InsuranceContract$new(
  tarif = Tarif.Endowment,
  sumInsured = 10000,
  age = 50, policyPeriod = 15,
  
  contractClosing = as.Date("2020-09-01"),
  adjustCashFlows = function(x, ...) { x[1:3, "death_SumInsured"] = 0; x }
)

contract.Endow.Waiting$Values$cashFlows[,c("premiums_advance", "survival_advance", "death_SumInsured")] %>% pander
  premiums_advance survival_advance death_SumInsured
0 1 0 0
1 1 0 0
2 1 0 0
3 1 0 1
4 1 0 1
5 1 0 1
6 1 0 1
7 1 0 1
8 1 0 1
9 1 0 1
10 1 0 1
11 1 0 1
12 1 0 1
13 1 0 1
14 1 0 1
15 0 1 0

contractGridPremium(
  axes = list(age = seq(20, 80, 10), adjustCashFlows = c(function(x, ...) x, function(x, ...) { x[1:3, "death_SumInsured"] = 0; x })),
  tarif = Tarif.Endowment,
  sumInsured = 10000,
  policyPeriod = 15,
  
  contractClosing = as.Date("2020-09-01")
) %>% `colnames<-`(c("Full benefit", "Waiting period"))
#>     adjustCashFlows
#> age  Full benefit Waiting period
#>   20     757.7658       756.5403
#>   30     758.5549       757.3652
#>   40     764.1521       761.6905
#>   50     781.2527       773.6783
#>   60     818.9058       798.1578
#>   70     916.0785       867.0736
#>   80    1330.8058      1121.3074