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

Add further profit participation functions; Implement Terminal Bonus Fund

parent 3c72d5ee
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,9 @@ export(PP.base.contractualReserve) ...@@ -21,7 +21,9 @@ export(PP.base.contractualReserve)
export(PP.base.meanContractualReserve) export(PP.base.meanContractualReserve)
export(PP.base.previousContractualReserve) export(PP.base.previousContractualReserve)
export(PP.base.sumInsured) export(PP.base.sumInsured)
export(PP.base.totalProfitAssignment)
export(PP.benefit.Profit) export(PP.benefit.Profit)
export(PP.benefit.ProfitGuaranteeSupporting)
export(PP.benefit.ProfitPlusGuaranteedInterest) export(PP.benefit.ProfitPlusGuaranteedInterest)
export(PP.benefit.ProfitPlusHalfGuaranteedInterest) export(PP.benefit.ProfitPlusHalfGuaranteedInterest)
export(PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal) export(PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal)
...@@ -29,6 +31,8 @@ export(PP.benefit.ProfitPlusHalfTotalInterest) ...@@ -29,6 +31,8 @@ export(PP.benefit.ProfitPlusHalfTotalInterest)
export(PP.benefit.ProfitPlusInterestMinGuaranteeTotal) export(PP.benefit.ProfitPlusInterestMinGuaranteeTotal)
export(PP.benefit.ProfitPlusTerminalBonusReserve) export(PP.benefit.ProfitPlusTerminalBonusReserve)
export(PP.benefit.ProfitPlusTotalInterest) export(PP.benefit.ProfitPlusTotalInterest)
export(PP.benefit.TerminalBonus)
export(PP.benefit.TerminalBonus5Years)
export(PP.benefit.TerminalBonus5YearsProRata) export(PP.benefit.TerminalBonus5YearsProRata)
export(PP.calculate.RateOnBase) export(PP.calculate.RateOnBase)
export(PP.calculate.RateOnBaseMin0) export(PP.calculate.RateOnBaseMin0)
...@@ -42,7 +46,7 @@ export(PP.rate.interestProfitPlusGuarantee) ...@@ -42,7 +46,7 @@ export(PP.rate.interestProfitPlusGuarantee)
export(PP.rate.riskProfit) export(PP.rate.riskProfit)
export(PP.rate.sumProfit) export(PP.rate.sumProfit)
export(PP.rate.terminalBonus) export(PP.rate.terminalBonus)
export(PP.rate.terminalBonusFundRatio) export(PP.rate.terminalBonusFund)
export(PP.rate.totalInterest) export(PP.rate.totalInterest)
export(PP.rate.totalInterest2) export(PP.rate.totalInterest2)
export(ProfitParticipation) export(ProfitParticipation)
......
...@@ -162,7 +162,7 @@ InsuranceContract.ParameterDefaults = list( ...@@ -162,7 +162,7 @@ InsuranceContract.ParameterDefaults = list(
expenseProfitRate = NULL, expenseProfitRate = NULL,
sumProfitRate = NULL, sumProfitRate = NULL,
terminalBonusRate = NULL, terminalBonusRate = NULL,
terminalBonusQuote = 0, terminalBonusFundRate = NULL,
profitParticipationScheme = NULL, # Gewinnbeteiligungssystem (object of class Profit Participation) profitParticipationScheme = NULL, # Gewinnbeteiligungssystem (object of class Profit Participation)
profitComponents = c("interest", "risk", "expense", "sum", "terminal"), profitComponents = c("interest", "risk", "expense", "sum", "terminal"),
......
...@@ -36,7 +36,8 @@ ProfitParticipation = R6Class( ...@@ -36,7 +36,8 @@ ProfitParticipation = R6Class(
getExpenseProfitBase = PP.base.sumInsured, getExpenseProfitBase = PP.base.sumInsured,
getSumProfitBase = PP.base.sumInsured, getSumProfitBase = PP.base.sumInsured,
getTerminalBonusBase = PP.base.sumInsured, getTerminalBonusBase = PP.base.sumInsured,
getTerminalBonusFundBase = PP.base.totalProfitAssignment,
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Profit rates for the various types of profit # Profit rates for the various types of profit
# Can / shall be overridden in child classes that use other schemes! # Can / shall be overridden in child classes that use other schemes!
...@@ -46,7 +47,9 @@ ProfitParticipation = R6Class( ...@@ -46,7 +47,9 @@ ProfitParticipation = R6Class(
getExpenseProfitRate = PP.rate.expenseProfit, getExpenseProfitRate = PP.rate.expenseProfit,
getSumProfitRate = PP.rate.sumProfit, getSumProfitRate = PP.rate.sumProfit,
getTerminalBonusRate = PP.rate.terminalBonus, getTerminalBonusRate = PP.rate.terminalBonus,
getTerminalBonusFundRate= PP.rate.terminalBonusFund,
getInterestOnProfits = PP.rate.totalInterest, getInterestOnProfits = PP.rate.totalInterest,
...@@ -61,6 +64,7 @@ ProfitParticipation = R6Class( ...@@ -61,6 +64,7 @@ ProfitParticipation = R6Class(
n = length(terminalBonusAccount) n = length(terminalBonusAccount)
terminalBonusAccount * 1/(1.07) ^ ((n - 1):0) terminalBonusAccount * 1/(1.07) ^ ((n - 1):0)
}, },
calculateTerminalBonusFund = PP.calculate.RateOnBase,
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Calculations of the assigned profit amounts, based on the bases and # Calculations of the assigned profit amounts, based on the bases and
...@@ -144,7 +148,7 @@ ProfitParticipation = R6Class( ...@@ -144,7 +148,7 @@ ProfitParticipation = R6Class(
# profitRates # profitRates
# 2) Contract can override individual rates (either for calendar years or contract years): # 2) Contract can override individual rates (either for calendar years or contract years):
# guaranteedInterest, interestProfitRate, totalInterest, mortalityProfitRate, # guaranteedInterest, interestProfitRate, totalInterest, mortalityProfitRate,
# expenseProfitRate, sumProfitRate, terminalBonusRate, terminalBonusFundRatio # expenseProfitRate, sumProfitRate, terminalBonusRate, terminalBonusFundRate
# 3) Explicit function arguments (either for calendar years or contract years). # 3) Explicit function arguments (either for calendar years or contract years).
# 4) Any missing values will be taken from the last given year # 4) Any missing values will be taken from the last given year
startYear = year(params$ContractData$contractClosing); startYear = year(params$ContractData$contractClosing);
...@@ -156,7 +160,7 @@ ProfitParticipation = R6Class( ...@@ -156,7 +160,7 @@ ProfitParticipation = R6Class(
"guaranteedInterest", "interestProfitRate", "totalInterest", "interestProfitRate2", "totalInterest2", "guaranteedInterest", "interestProfitRate", "totalInterest", "interestProfitRate2", "totalInterest2",
"mortalityProfitRate", "expenseProfitRate", "expenseProfitRate_premiumfree", "mortalityProfitRate", "expenseProfitRate", "expenseProfitRate_premiumfree",
"sumProfitRate", "sumProfitRate",
"terminalBonusRate", "terminalBonusFundRatio") "terminalBonusRate", "terminalBonusFundRate")
rates = data.frame(matrix(ncol = length(columns), nrow = length(years), dimnames = list(years = years, rates = columns))) rates = data.frame(matrix(ncol = length(columns), nrow = length(years), dimnames = list(years = years, rates = columns)))
rates$year = years; rates$year = years;
...@@ -240,7 +244,6 @@ ProfitParticipation = R6Class( ...@@ -240,7 +244,6 @@ ProfitParticipation = R6Class(
} else { } else {
waitingFactor = 1; waitingFactor = 1;
} }
rates = self$setupRates(params = params, values = values, ...) rates = self$setupRates(params = params, values = values, ...)
intBase = self$Functions$getInterestProfitBase(rates = rates, params = params, values = values); intBase = self$Functions$getInterestProfitBase(rates = rates, params = params, values = values);
...@@ -289,6 +292,7 @@ ProfitParticipation = R6Class( ...@@ -289,6 +292,7 @@ ProfitParticipation = R6Class(
totalProfit = c(0) totalProfit = c(0)
); );
# res = self$Functions$calculateInterestOnProfit(base = sumBase, rate = sumRate, waiting = waitingFactor, rates = rates, params = params, values = values);
prev = 0; prev = 0;
for (i in 1:nrow(res)) { for (i in 1:nrow(res)) {
res[i,"interestOnProfit"] = res[i,"interestOnProfitRate"] * prev; res[i,"interestOnProfit"] = res[i,"interestOnProfitRate"] * prev;
...@@ -297,7 +301,7 @@ ProfitParticipation = R6Class( ...@@ -297,7 +301,7 @@ ProfitParticipation = R6Class(
prev = res[i,"totalProfit"]; prev = res[i,"totalProfit"];
} }
#### OLD Terminal bonus (not through terminal bonus fund, i.e. part of ongoing profits, but in addition) ####
#### Terminal Bonus calculations (might depend on the individual profit assignments calculated above! #### Terminal Bonus calculations (might depend on the individual profit assignments calculated above!
#### => TODO: Pass the current profit calculation inside the values!) #### => TODO: Pass the current profit calculation inside the values!)
terminalBase = self$Functions$getTerminalBonusBase(res, rates = rates, params = params, values = values); terminalBase = self$Functions$getTerminalBonusBase(res, rates = rates, params = params, values = values);
...@@ -315,6 +319,22 @@ ProfitParticipation = R6Class( ...@@ -315,6 +319,22 @@ ProfitParticipation = R6Class(
terminalBonusReserve = c(terminalBonusReserves) terminalBonusReserve = c(terminalBonusReserves)
) )
#### NEW Terminal bonus fund (part of regular profits, but not paid out on surrender, reserved as part of the free RfB) ####
TBFBase = self$Functions$getTerminalBonusFundBase(res, rates = rates, params = params, values = values);
TBFRate = self$Functions$getTerminalBonusFundRate(res, rates = rates, params = params, values = values);
TBFBonus = self$Functions$calculateTerminalBonusFund(res, base = TBFBase, rate = TBFRate, waiting = waitingFactor, rates = rates, params = params, values = values);
regularBonus = res[,"totalProfitAssignment"] - TBFBonus
res = cbind(
res,
TBFBase = c(TBFBase),
TBFRate = c(TBFRate),
TBFAssignment = c(TBFBonus),
regularBonusAssignment = regularBonus,
TBF = cumsum(TBFBonus),
regularBonus = cumsum(regularBonus)
)
survival = self$Functions$calculateSurvivalBenefit(res, rates = rates, params = params, values = values); survival = self$Functions$calculateSurvivalBenefit(res, rates = rates, params = params, values = values);
...@@ -362,10 +382,15 @@ ProfitParticipation = R6Class( ...@@ -362,10 +382,15 @@ ProfitParticipation = R6Class(
toremove = c(toremove, grep("^sum", cnames)); toremove = c(toremove, grep("^sum", cnames));
} }
if (!"terminal" %in% params$ProfitParticipation$profitComponents) { if (!"terminal" %in% params$ProfitParticipation$profitComponents) {
toremove = c(toremove, toremove = c(toremove,
grep("^terminal", cnames), grep("^terminal", cnames),
grep("^.*TerminalBonus$", cnames) grep("^.*TerminalBonus$", cnames)
); );
}
if (!"TBF" %in% params$ProfitParticipation$profitComponents) {
toremove = c(toremove,
grep("^TBF", cnames)
);
} }
if (length(toremove) > 0) { if (length(toremove) > 0) {
res = res[,-toremove] res = res[,-toremove]
......
...@@ -17,11 +17,11 @@ shiftBy = function(rate, n = 1) { ...@@ -17,11 +17,11 @@ shiftBy = function(rate, n = 1) {
res = c(rep(0, n), head(rate, -n)) res = c(rep(0, n), head(rate, -n))
names(res) = nm names(res) = nm
res res
} }
##########################################################################m## ##########################################################################m##
# Calculation bases for the various types of profit #### # Calculation bases for the various types of profit ####
##########################################################################m## ##########################################################################m##
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
...@@ -80,10 +80,15 @@ PP.base.ZillmerRiskPremium = function(rates, params, values, ...) { ...@@ -80,10 +80,15 @@ PP.base.ZillmerRiskPremium = function(rates, params, values, ...) {
#' Basis for expense/sum profit: sum insured #' Basis for expense/sum profit: sum insured
#' @export #' @export
PP.base.sumInsured = function(rates, params, values, ...) { PP.base.sumInsured = function(rates, params, values, ...) {
params$ContractData$sumInsured params$ContractData$sumInsured
}; };
#' @describeIn ProfitParticipationFunctions
#' Basis for Terminal Bonus Fund Assignment: total profit assignment of the year
#' @export
PP.base.totalProfitAssignment = function(res, ...) {
res[,"totalProfitAssignment"]
}
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -94,41 +99,41 @@ PP.base.sumInsured = function(rates, params, values, ...) { ...@@ -94,41 +99,41 @@ PP.base.sumInsured = function(rates, params, values, ...) {
#' Returns the array of interest profit rates (keyed by year) #' Returns the array of interest profit rates (keyed by year)
#' @export #' @export
PP.rate.interestProfit = function(rates, ...) { PP.rate.interestProfit = function(rates, ...) {
rates$interestProfitRate rates$interestProfitRate
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Returns the array of risk profit rates (keyed by year) #' Returns the array of risk profit rates (keyed by year)
#' @export #' @export
PP.rate.riskProfit = function(rates, ...) { PP.rate.riskProfit = function(rates, ...) {
rates$mortalityProfitRate rates$mortalityProfitRate
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Returns the array of expense profit rates (keyed by year) #' Returns the array of expense profit rates (keyed by year)
#' @export #' @export
PP.rate.expenseProfit = function(rates, ...) { PP.rate.expenseProfit = function(rates, ...) {
rates$expenseProfitRate rates$expenseProfitRate
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Returns the array of sum profit rates (keyed by year) #' Returns the array of sum profit rates (keyed by year)
#' @export #' @export
PP.rate.sumProfit = function(rates, ...) { PP.rate.sumProfit = function(rates, ...) {
rates$sumProfitRate rates$sumProfitRate
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Returns the array of terminal bonus rates (keyed by year) #' Returns the array of terminal bonus rates (keyed by year)
#' @export #' @export
PP.rate.terminalBonus = function(rates, ...) { PP.rate.terminalBonus = function(rates, ...) {
rates$terminalBonusRate rates$terminalBonusRate
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Returns the array of terminal bonus rates (keyed by year) as the terminal bonus fund ratio #' Returns the array of terminal bonus rates (keyed by year) as the terminal bonus fund ratio
#' @export #' @export
PP.rate.terminalBonusFundRatio = function(rates, ...) { PP.rate.terminalBonusFund = function(rates, ...) {
rates$terminalBonusFundRatio rates$terminalBonusFundRate
}; };
...@@ -150,28 +155,28 @@ PP.rate.interestProfit2PlusGuarantee = function(rates, ...) { ...@@ -150,28 +155,28 @@ PP.rate.interestProfit2PlusGuarantee = function(rates, ...) {
#' Rate for interest on past profits: total interest rate #' Rate for interest on past profits: total interest rate
#' @export #' @export
PP.rate.totalInterest = function(rates, ...) { PP.rate.totalInterest = function(rates, ...) {
rates$totalInterest rates$totalInterest
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Rate for interest on past profits: second total interest rate #' Rate for interest on past profits: second total interest rate
#' @export #' @export
PP.rate.totalInterest2 = function(rates, ...) { PP.rate.totalInterest2 = function(rates, ...) {
rates$totalInterest2 rates$totalInterest2
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Rate for interest on past profits: second interest profit rate (not including guaranteed interest), keyed by year #' Rate for interest on past profits: second interest profit rate (not including guaranteed interest), keyed by year
#' @export #' @export
PP.rate.interestProfit2 = function(rates, ...) { PP.rate.interestProfit2 = function(rates, ...) {
rates$interestProfitRate2 rates$interestProfitRate2
}; };
# TODO # TODO
getTerminalBonusReserves = function(profits, rates, terminalBonus, terminalBonusAccount, params, values, ...) { getTerminalBonusReserves = function(profits, rates, terminalBonus, terminalBonusAccount, params, values, ...) {
n = length(terminalBonusAccount) n = length(terminalBonusAccount)
terminalBonusAccount * 1/(1.07) ^ ((n - 1):0) terminalBonusAccount * 1/(1.07) ^ ((n - 1):0)
}; };
...@@ -185,28 +190,28 @@ getTerminalBonusReserves = function(profits, rates, terminalBonus, terminalBonus ...@@ -185,28 +190,28 @@ getTerminalBonusReserves = function(profits, rates, terminalBonus, terminalBonus
#' Calculate profit by a simple rate applied on the basis (with an optional waiting vector of values 0 or 1) #' Calculate profit by a simple rate applied on the basis (with an optional waiting vector of values 0 or 1)
#' @export #' @export
PP.calculate.RateOnBase = function(base, rate, waiting, rates, params, values, ...) { PP.calculate.RateOnBase = function(base, rate, waiting, rates, params, values, ...) {
base * rate * waiting base * rate * waiting
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate profit by a simple rate applied on the basis (with an optional waiting vector of values 0 or 1), bound below by 0 #' Calculate profit by a simple rate applied on the basis (with an optional waiting vector of values 0 or 1), bound below by 0
#' @export #' @export
PP.calculate.RateOnBaseMin0 = function(base, rate, waiting, rates, params, values, ...) { PP.calculate.RateOnBaseMin0 = function(base, rate, waiting, rates, params, values, ...) {
pmax(0, base * rate * waiting) pmax(0, base * rate * waiting)
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate profit by a rate + guaranteed interest applied on the basis (with an optional waiting vector of values 0 or 1) #' Calculate profit by a rate + guaranteed interest applied on the basis (with an optional waiting vector of values 0 or 1)
#' @export #' @export
PP.calculate.RatePlusGuaranteeOnBase = function(base, rate, waiting, rates, params, values, ...) { PP.calculate.RatePlusGuaranteeOnBase = function(base, rate, waiting, rates, params, values, ...) {
base * (rate + rates$guaranteedInterest) * waiting base * (rate + rates$guaranteedInterest) * waiting
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate profit by a simple rate applied on the basis (with only (1-SGFFactor) put into profit participation, and an optional waiting vector of values 0 or 1) #' Calculate profit by a simple rate applied on the basis (with only (1-SGFFactor) put into profit participation, and an optional waiting vector of values 0 or 1)
#' @export #' @export
PP.calculate.RateOnBaseSGFFactor = function(base, rate, waiting, rates, params, values, ...) { PP.calculate.RateOnBaseSGFFactor = function(base, rate, waiting, rates, params, values, ...) {
base * rate * waiting * (1 - rates$terminalBonusFundRatio) base * rate * waiting * (1 - rates$terminalBonusFund)
}; };
...@@ -220,64 +225,86 @@ PP.calculate.RateOnBaseSGFFactor = function(base, rate, waiting, rates, params, ...@@ -220,64 +225,86 @@ PP.calculate.RateOnBaseSGFFactor = function(base, rate, waiting, rates, params,
#' Calculate survival benefit as total profit amount plus the terminal bonus reserve #' Calculate survival benefit as total profit amount plus the terminal bonus reserve
#' @export #' @export
PP.benefit.ProfitPlusTerminalBonusReserve = function(profits, ...) { PP.benefit.ProfitPlusTerminalBonusReserve = function(profits, ...) {
profits[,"totalProfit"] + profits[,"terminalBonusReserve"] profits[,"regularBonus"] + profits[,"TBF"] + profits[,"terminalBonusReserve"]
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate benefit as total profit accrued so far #' Calculate benefit as total profit accrued so far
#' @export #' @export
PP.benefit.Profit = function(profits, ...) { PP.benefit.Profit = function(profits, ...) {
profits[,"totalProfit"] profits[,"regularBonus"]
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate accrued death benefit as total profit with (guaranteed) interest for one year #' Calculate accrued death benefit as total profit with (guaranteed) interest for one year
#' @export #' @export
PP.benefit.ProfitPlusGuaranteedInterest = function(profits, rates, ...) { PP.benefit.ProfitPlusGuaranteedInterest = function(profits, rates, ...) {
profits[,"totalProfit"] * (1 + rates$guaranteedInterest) profits[,"regularBonus"] * (1 + rates$guaranteedInterest)
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate accrued death benefit as total profit with total interest (interest on profit rate) for one year #' Calculate accrued death benefit as total profit with total interest (interest on profit rate) for one year
#' @export #' @export
PP.benefit.ProfitPlusTotalInterest = function(profits, rates, params, values) { PP.benefit.ProfitPlusTotalInterest = function(profits, rates, params, values) {
profits[,"totalProfit"] * (1 + profits[,"interestOnProfitRate"]) profits[,"regularBonus"] * (1 + profits[,"interestOnProfitRate"])
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate accrued benefit as total profit with total interest (interest on profit rate) for half a year #' Calculate accrued benefit as total profit with total interest (interest on profit rate) for half a year
#' @export #' @export
PP.benefit.ProfitPlusHalfTotalInterest = function(profits, ...) { PP.benefit.ProfitPlusHalfTotalInterest = function(profits, ...) {
profits[,"totalProfit"] * (1 + profits[,"interestOnProfitRate"]/2) profits[,"regularBonus"] * (1 + profits[,"interestOnProfitRate"]/2)
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate death benefit as total profit with (guaranteed) interest for one year #' Calculate death benefit as total profit with (guaranteed) interest for one year
#' @export #' @export
PP.benefit.ProfitPlusHalfGuaranteedInterest = function(profits, rates, ...) { PP.benefit.ProfitPlusHalfGuaranteedInterest = function(profits, rates, ...) {
profits[,"totalProfit"] * (1 + rates$guaranteedInterest/2) profits[,"regularBonus"] * (1 + rates$guaranteedInterest/2)
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate accrued benefit as total profit with interest for one year (min of guarantee and total interest) #' Calculate accrued benefit as total profit with interest for one year (min of guarantee and total interest)
#' @export #' @export
PP.benefit.ProfitPlusInterestMinGuaranteeTotal = function(profits, rates, ...) { PP.benefit.ProfitPlusInterestMinGuaranteeTotal = function(profits, rates, ...) {
profits[,"totalProfit"] * (1 + pmin(rates$guaranteedInterest, rates$totalInterest)) profits[,"regularBonus"] * (1 + pmin(rates$guaranteedInterest, rates$totalInterest))
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate accrued benefit as total profit with interest for half a year (min of guarantee and total interest) #' Calculate accrued benefit as total profit with interest for half a year (min of guarantee and total interest)
#' @export #' @export
PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal = function(profits, rates, ...) { PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal = function(profits, rates, ...) {
profits[,"totalProfit"] * (1 + pmin(rates$guaranteedInterest, rates$totalInterest)/2) profits[,"regularBonus"] * (1 + pmin(rates$guaranteedInterest, rates$totalInterest)/2)
};
#' @describeIn ProfitParticipationFunctions
#' Calculate accrued benefit as regular profit, but used to cover initial Zillmerization
#' @export
PP.benefit.ProfitGuaranteeSupporting = function(profits, rates, params, values, ...) {
pmax(0, values$reserves[,"contractual"] + profits[,"regularBonus"] - pmax(0, values$reserves[,"contractual"]))
}; };
#' @describeIn ProfitParticipationFunctions #' @describeIn ProfitParticipationFunctions
#' Calculate benefit from terminal bonus as 1/n parts of the terminal bonus reserve during the last 5 years #' Calculate benefit from terminal bonus as 1/n parts of the terminal bonus reserve during the last 5 years
#' @export #' @export
PP.benefit.TerminalBonus5YearsProRata = function(profits, params, ...) { PP.benefit.TerminalBonus5YearsProRata = function(profits, params, ...) {
n = params$ContractData$policyPeriod; n = params$ContractData$policyPeriod;
profits[, "terminalBonusReserve"] * (0:n)/n * ((0:n) >= max(10, n - 5)) (profits[, "terminalBonusReserve"] + profits[, "TBF"]) * (0:n)/n * ((0:n) >= max(10, n - 5))
};
#' @describeIn ProfitParticipationFunctions
#' Terminal bonus is only paid out during the last 5 years of the contract (but never during the first 10 year)
#' @export
PP.benefit.TerminalBonus5Years = function(profits, params, ...) {
n = params$ContractData$policyPeriod;
(profits[, "terminalBonusReserve"] + profits[, "TBF"]) * ((0:n) >= max(10, n - 5))
}
#' @describeIn ProfitParticipationFunctions
#' Calculate benefit from terminal bonus (full bonus), either old-style terminal bonus reserve or Terminal Bonus Fund (TBF)
#' @export
PP.benefit.TerminalBonus = function(profits, params, ...) {
profits[, "terminalBonusReserve"] + profits[, "TBF"]
}; };
"dummy" "dummy"
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
\alias{PP.base.meanContractualReserve} \alias{PP.base.meanContractualReserve}
\alias{PP.base.ZillmerRiskPremium} \alias{PP.base.ZillmerRiskPremium}
\alias{PP.base.sumInsured} \alias{PP.base.sumInsured}
\alias{PP.base.totalProfitAssignment}
\alias{PP.rate.interestProfit} \alias{PP.rate.interestProfit}
\alias{PP.rate.riskProfit} \alias{PP.rate.riskProfit}
\alias{PP.rate.expenseProfit} \alias{PP.rate.expenseProfit}
\alias{PP.rate.sumProfit} \alias{PP.rate.sumProfit}
\alias{PP.rate.terminalBonus} \alias{PP.rate.terminalBonus}
\alias{PP.rate.terminalBonusFundRatio} \alias{PP.rate.terminalBonusFund}
\alias{PP.rate.interestProfitPlusGuarantee} \alias{PP.rate.interestProfitPlusGuarantee}
\alias{PP.rate.interestProfit2PlusGuarantee} \alias{PP.rate.interestProfit2PlusGuarantee}
\alias{PP.rate.totalInterest} \alias{PP.rate.totalInterest}
...@@ -33,7 +34,10 @@ ...@@ -33,7 +34,10 @@
\alias{PP.benefit.ProfitPlusHalfGuaranteedInterest} \alias{PP.benefit.ProfitPlusHalfGuaranteedInterest}
\alias{PP.benefit.ProfitPlusInterestMinGuaranteeTotal} \alias{PP.benefit.ProfitPlusInterestMinGuaranteeTotal}
\alias{PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal} \alias{PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal}
\alias{PP.benefit.ProfitGuaranteeSupporting}
\alias{PP.benefit.TerminalBonus5YearsProRata} \alias{PP.benefit.TerminalBonus5YearsProRata}
\alias{PP.benefit.TerminalBonus5Years}
\alias{PP.benefit.TerminalBonus}
\title{Helper functions for profit participation} \title{Helper functions for profit participation}
\usage{ \usage{
PP.base.NULL(rates, params, values, ...) PP.base.NULL(rates, params, values, ...)
...@@ -52,6 +56,8 @@ PP.base.ZillmerRiskPremium(rates, params, values, ...) ...@@ -52,6 +56,8 @@ PP.base.ZillmerRiskPremium(rates, params, values, ...)
PP.base.sumInsured(rates, params, values, ...) PP.base.sumInsured(rates, params, values, ...)
PP.base.totalProfitAssignment(res, ...)
PP.rate.interestProfit(rates, ...) PP.rate.interestProfit(rates, ...)
PP.rate.riskProfit(rates, ...) PP.rate.riskProfit(rates, ...)
...@@ -62,7 +68,7 @@ PP.rate.sumProfit(rates, ...) ...@@ -62,7 +68,7 @@ PP.rate.sumProfit(rates, ...)
PP.rate.terminalBonus(rates, ...) PP.rate.terminalBonus(rates, ...)
PP.rate.terminalBonusFundRatio(rates, ...) PP.rate.terminalBonusFund(rates, ...)
PP.rate.interestProfitPlusGuarantee(rates, ...) PP.rate.interestProfitPlusGuarantee(rates, ...)
...@@ -101,7 +107,13 @@ PP.benefit.ProfitPlusInterestMinGuaranteeTotal(profits, rates, ...) ...@@ -101,7 +107,13 @@ PP.benefit.ProfitPlusInterestMinGuaranteeTotal(profits, rates, ...)
PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal(profits, rates, ...) PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal(profits, rates, ...)
PP.benefit.ProfitGuaranteeSupporting(profits, rates, params, values, ...)
PP.benefit.TerminalBonus5YearsProRata(profits, params, ...) PP.benefit.TerminalBonus5YearsProRata(profits, params, ...)
PP.benefit.TerminalBonus5Years(profits, params, ...)
PP.benefit.TerminalBonus(profits, params, ...)
} }
\description{ \description{
Various helper functions for the \code{ProfitParticipation} class that Various helper functions for the \code{ProfitParticipation} class that
...@@ -126,6 +138,8 @@ the rates and how the assigned profit is calculated. ...@@ -126,6 +138,8 @@ the rates and how the assigned profit is calculated.
\item \code{PP.base.sumInsured}: Basis for expense/sum profit: sum insured \item \code{PP.base.sumInsured}: Basis for expense/sum profit: sum insured
\item \code{PP.base.totalProfitAssignment}: Basis for Terminal Bonus Fund Assignment: total profit assignment of the year
\item \code{PP.rate.interestProfit}: Returns the array of interest profit rates (keyed by year) \item \code{PP.rate.interestProfit}: Returns the array of interest profit rates (keyed by year)
\item \code{PP.rate.riskProfit}: Returns the array of risk profit rates (keyed by year) \item \code{PP.rate.riskProfit}: Returns the array of risk profit rates (keyed by year)
...@@ -136,7 +150,7 @@ the rates and how the assigned profit is calculated. ...@@ -136,7 +150,7 @@ the rates and how the assigned profit is calculated.
\item \code{PP.rate.terminalBonus}: Returns the array of terminal bonus rates (keyed by year) \item \code{PP.rate.terminalBonus}: Returns the array of terminal bonus rates (keyed by year)
\item \code{PP.rate.terminalBonusFundRatio}: Returns the array of terminal bonus rates (keyed by year) as the terminal bonus fund ratio \item \code{PP.rate.terminalBonusFund}: Returns the array of terminal bonus rates (keyed by year) as the terminal bonus fund ratio
\item \code{PP.rate.interestProfitPlusGuarantee}: Rate for interest on past profits: total credited rate, but at least the guarantee \item \code{PP.rate.interestProfitPlusGuarantee}: Rate for interest on past profits: total credited rate, but at least the guarantee
...@@ -172,6 +186,12 @@ the rates and how the assigned profit is calculated. ...@@ -172,6 +186,12 @@ the rates and how the assigned profit is calculated.
\item \code{PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal}: Calculate accrued benefit as total profit with interest for half a year (min of guarantee and total interest) \item \code{PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal}: Calculate accrued benefit as total profit with interest for half a year (min of guarantee and total interest)
\item \code{PP.benefit.ProfitGuaranteeSupporting}: Calculate accrued benefit as regular profit, but used to cover initial Zillmerization
\item \code{PP.benefit.TerminalBonus5YearsProRata}: Calculate benefit from terminal bonus as 1/n parts of the terminal bonus reserve during the last 5 years \item \code{PP.benefit.TerminalBonus5YearsProRata}: Calculate benefit from terminal bonus as 1/n parts of the terminal bonus reserve during the last 5 years
\item \code{PP.benefit.TerminalBonus5Years}: Terminal bonus is only paid out during the last 5 years of the contract (but never during the first 10 year)
\item \code{PP.benefit.TerminalBonus}: Calculate benefit from terminal bonus (full bonus), either old-style terminal bonus reserve or Terminal Bonus Fund (TBF)
}} }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment