Skip to content
Snippets Groups Projects
Commit 5d86b8d0 authored by Kainhofer Reinhold's avatar Kainhofer Reinhold
Browse files

implement invalidityEndsContract flag (default TRUE)

If this flag is set (default), the contract ends when invalidity happens, i.e. the survival probability of the contract is
   px = 1 - qx - ix
If the flag is set to FALSE, a dread-disease/disability/morbidity claim is paid with propbability ix, but the contract continues, potentially paying our further disease claims in the future
parent 4461335a
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,7 @@ InsuranceContract.ParameterDefaults = list(
ActuarialBases = list(
mortalityTable = NULL,
invalidityTable = NULL,
invalidityEndsContract = FALSE, # Whether a claim for disease ends the contract or not
i = 0.00, # guaranteed interest rate
balanceSheetDate = as.Date("1900-12-31"), # Balance sheet date (for the calculation of the balance sheet reserves, year is irrelevant)
balanceSheetMethod = "30/360",
......
......@@ -106,8 +106,13 @@ InsuranceTarif = R6Class(
i = rep(0, length(q));
}
i = pad0(i, length(q));
# TODO: Implement case where invalidity/disease does NOT end the contract!
df = data.frame(age = ages, q = q, i = i, p = 1 - q - i, row.names = ages - age)
# invalidity/disease does NOT end the contract if flag is set!
if (params$ActuarialBases$invalidityEndsContract) {
p = 1 - q - i
} else {
p = 1 - q
}
df = data.frame(age = ages, q = q, i = i, p = p, row.names = ages - age)
df
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment