From 606b96f1df34f67642b52482e881f3f8202c0ea0 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer <reinhold@kainhofer.com> Date: Fri, 26 Nov 2021 23:56:40 +0100 Subject: [PATCH] Clean up death benefit proportios -) Params deathBEnefitProportion and widowBenefitProportion haven't been used => removed --- R/InsuranceParameters.R | 10 +--------- inst/Beispiele/Example_Endowment.R | 9 ++++++++- man/InsuranceContract.ParameterDefaults.Rd | 6 ------ vignettes/using-the-lifeinsurancecontracts-package.Rmd | 4 ++-- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/R/InsuranceParameters.R b/R/InsuranceParameters.R index 77e788e..f5e3720 100644 --- a/R/InsuranceParameters.R +++ b/R/InsuranceParameters.R @@ -317,12 +317,6 @@ InsuranceContract.Values = list( #' "in arrears"} #' \item{\code{$premiumFrequency}}{Number of premium payments per year, default is 1.} #' \item{\code{$benefitFrequency}}{Number of benefit payments per year, default is 1.} -#' \item{\code{$widowProportion}}{For annuities with a widow transition, -#' this describes the factor of the widow benefits relative to -#' the original benefit.} -#' \item{\code{$deathBenefitProportion}}{For endowments with a death and -#' survival benefit, this describes the proportion of the death -#' benefit relative to the survival benefit.} #' \item{\code{$premiumRefund}}{Proportion of (gross) premiums refunded on #' death (including additional risk, e.g. 1.10 = 110% of paid premiums)} #' \item{\code{$premiumIncrease}}{The yearly growth factor of the premium, @@ -544,12 +538,10 @@ InsuranceContract.ParameterDefaults = list( premiumFrequency = 1, # number of premium payments per year benefitFrequency = 1, # number of benefit payments per year (for annuities) or death benefit at the end of every 1/k-th year - widowProportion = 0, # widow transition factor (on sum insured) - deathBenefitProportion = 1, # For endowments: Proportion of the death benefit relative to the life benefit premiumRefund = 0, # Proportion of premiums refunded on death (including additional risk, e.g. 1.10 = 110% of paid premiums) premiumIncrease = 1, # The yearly growth factor of the premium, i.e. 1.05 means +5% increase each year; a Vector describes the premiums for all years annuityIncrease = 1, # The yearly growth factor of the annuity payments, i.e. 1.05 means +5% incrase each year; a vector describes the annuity unit payments for all years - deathBenefit = 1, # The yearly relative death benefit (relative to the initial sum insured); Can be set to a function(len, params, values), e.g. deathBenefit = deathBenefit.linearDecreasing + deathBenefit = 1, # The yearly relative death benefit (relative to the initial sum insured); Can be fixed, e.g. 0.5 for 50% death cover, or set to a function(len, params, values) like deathBenefit = deathBenefit.linearDecreasing costWaiver = 0 # The cost waiver (up to minCosts, 0=no cost waiver, 1=full cost waiver down to minCosts) ), diff --git a/inst/Beispiele/Example_Endowment.R b/inst/Beispiele/Example_Endowment.R index 74d9aed..0791875 100644 --- a/inst/Beispiele/Example_Endowment.R +++ b/inst/Beispiele/Example_Endowment.R @@ -1,5 +1,7 @@ library(LifeInsuranceContracts) library(MortalityTables) +library(lubridate) +mortalityTables.load("Austria_Census") ################################################################### # # DEFINITION TARIF #### @@ -37,7 +39,6 @@ surrender.Bsp = function(surrenderReserve, params, values) { surrenderReserve * sf } -#' @export Tarif.Bsp = InsuranceTarif$new( name = "Example Tariff - Standard Endowment", type = "endowment", @@ -49,6 +50,7 @@ Tarif.Bsp = InsuranceTarif$new( mortalityTable = mort.AT.census.2011.unisex, i = 0.005, costs = costs.Bsp, + Costs = costs.Bsp, unitcosts = costs.Bsp.Stueckkosten, premiumFrequencyOrder = -1, # Unterjährige Prämienzahlung wird nicht im BW berücksichtigt, sondern durch Prämienaufschlag @@ -75,6 +77,11 @@ contract.Bsp = InsuranceContract$ )$ addDynamics(t = 5, NewSumInsured = 200000, id = "Dynamik 1", i = 0.05, age = 70)$ addDynamics(t = 10, NewSumInsured = 250000, id = "Dynamik 2", i = 0.01); + +options('LIC.debug.premiumCalculation' = TRUE) +contract.Bsp$premiumWaiver(t = 13) + +options('LIC.debug.premiumCalculation' = FALSE) # exportInsuranceContractExample(contract.Bsp, t = 5); # showVmGlgExamples(contract.Bsp, t = 10) # diff --git a/man/InsuranceContract.ParameterDefaults.Rd b/man/InsuranceContract.ParameterDefaults.Rd index 1fc6fd8..925f970 100644 --- a/man/InsuranceContract.ParameterDefaults.Rd +++ b/man/InsuranceContract.ParameterDefaults.Rd @@ -93,12 +93,6 @@ are paid in advance (default) or arrears. Value is of type "in arrears"} \item{\code{$premiumFrequency}}{Number of premium payments per year, default is 1.} \item{\code{$benefitFrequency}}{Number of benefit payments per year, default is 1.} -\item{\code{$widowProportion}}{For annuities with a widow transition, -this describes the factor of the widow benefits relative to -the original benefit.} -\item{\code{$deathBenefitProportion}}{For endowments with a death and -survival benefit, this describes the proportion of the death -benefit relative to the survival benefit.} \item{\code{$premiumRefund}}{Proportion of (gross) premiums refunded on death (including additional risk, e.g. 1.10 = 110\% of paid premiums)} \item{\code{$premiumIncrease}}{The yearly growth factor of the premium, diff --git a/vignettes/using-the-lifeinsurancecontracts-package.Rmd b/vignettes/using-the-lifeinsurancecontracts-package.Rmd index 3d3bb24..78b77aa 100644 --- a/vignettes/using-the-lifeinsurancecontracts-package.Rmd +++ b/vignettes/using-the-lifeinsurancecontracts-package.Rmd @@ -637,7 +637,7 @@ However, the most important and often used parameters are: | `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) | +| `deathBenefit` | gives the factor of death benefit relative to the sum insured / survival benefit of endowments (1 means equal death and survival probabilities), can also be a function with non-constant values over time | | `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.| @@ -1846,7 +1846,7 @@ that uses this profit scheme: contract.Endow.PP = InsuranceContract$new( tarif = Tarif.Endowment, sumInsured = 10000, - deathBenefitProportion = 5, + deathBenefit = 5, age = 50, policyPeriod = 15, profitParticipationScheme = ProfitScheme.example, -- GitLab