diff --git a/R/HelperFunctions.R b/R/HelperFunctions.R index f813ea7fddb041927ee2e687cc85ccf879cda99e..37dc73e8d91d27daea774787d8036b9c0eb29cbc 100644 --- a/R/HelperFunctions.R +++ b/R/HelperFunctions.R @@ -174,11 +174,11 @@ deathBenefit.annuityDecreasing = function(interest) { protectionPeriod = params$ContractData$policyPeriod - params$ContractData$deferralPeriod; vk = 1/(1 + interest); if (interest == 0) { - sumInsured = (protectionPeriod:0) / protectionPeriod + benefit = (protectionPeriod:0) / protectionPeriod } else { - sumInsured = (vk ^ (protectionPeriod:0) - 1) / (vk ^ protectionPeriod - 1) + benefit = (vk ^ (protectionPeriod:0) - 1) / (vk ^ protectionPeriod - 1) } - pad0(sumInsured, l = len) + pad0(benefit, l = len) } }