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

Add some more helper functions for profit participation calculations (using...

Add some more helper functions for profit participation calculations (using total interest instead of guarantee+interestProfit if total interest is below guarantee)
parent c94abc90
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,9 @@ export(profPart.base.sumInsured)
export(profPart.benefit.Profit)
export(profPart.benefit.ProfitPlusGuaranteedInterest)
export(profPart.benefit.ProfitPlusHalfGuaranteedInterest)
export(profPart.benefit.ProfitPlusHalfInterestMinGuaranteeTotal)
export(profPart.benefit.ProfitPlusHalfTotalInterest)
export(profPart.benefit.ProfitPlusInterestMinGuaranteeTotal)
export(profPart.benefit.ProfitPlusTerminalBonusReserve)
export(profPart.benefit.ProfitPlusTotalInterest)
export(profPart.benefit.TerminalBonus5YearsProRata)
......@@ -39,6 +41,7 @@ export(profPart.calculate.RatePlusGuaranteeOnBase)
export(profPart.rate.expenseProfit)
export(profPart.rate.interestProfit)
export(profPart.rate.interestProfit2)
export(profPart.rate.interestProfitPlusGuarantee)
export(profPart.rate.riskProfit)
export(profPart.rate.sumProfit)
export(profPart.rate.terminalBonus)
......
......@@ -99,6 +99,13 @@ profPart.rate.terminalBonus = function(rates, params, values, ...) {
rates$terminalBonusRate
};
#' @describeIn ProfitParticipation
#' Rate for interest on past profits: total interest rate
#' @export
profPart.rate.interestProfitPlusGuarantee = function(rates, params, values, ...) {
rates$totalInterest + rates$guaranteedInterest
};
#' @describeIn ProfitParticipation
#' Rate for interest on past profits: total interest rate
#' @export
......@@ -196,6 +203,20 @@ profPart.benefit.ProfitPlusHalfGuaranteedInterest = function(profits, rates, par
profits[,"totalProfit"] * (1 + rates$guaranteedInterest/2)
};
#' @describeIn ProfitParticipation
#' Calculate accrued benefit as total profit with interest for one year (min of guarantee and total interest)
#' @export
profPart.benefit.ProfitPlusInterestMinGuaranteeTotal = function(profits, rates, params, values) {
profits[,"totalProfit"] * (1 + pmin(rates$guaranteedInterest, rates$totalInterest))
};
#' @describeIn ProfitParticipation
#' Calculate accrued benefit as total profit with interest for half a year (min of guarantee and total interest)
#' @export
profPart.benefit.ProfitPlusHalfInterestMinGuaranteeTotal = function(profits, rates, params, values) {
profits[,"totalProfit"] * (1 + pmin(rates$guaranteedInterest, rates$totalInterest)/2)
};
#' @describeIn ProfitParticipation
#' Calculate benefit from terminal bonus as 1/n parts of the terminal bonus reserve during the last 5 years
#' @export
......
......@@ -11,7 +11,9 @@
\alias{profPart.benefit.Profit}
\alias{profPart.benefit.ProfitPlusGuaranteedInterest}
\alias{profPart.benefit.ProfitPlusHalfGuaranteedInterest}
\alias{profPart.benefit.ProfitPlusHalfInterestMinGuaranteeTotal}
\alias{profPart.benefit.ProfitPlusHalfTotalInterest}
\alias{profPart.benefit.ProfitPlusInterestMinGuaranteeTotal}
\alias{profPart.benefit.ProfitPlusTerminalBonusReserve}
\alias{profPart.benefit.ProfitPlusTotalInterest}
\alias{profPart.benefit.TerminalBonus5YearsProRata}
......@@ -20,6 +22,7 @@
\alias{profPart.rate.expenseProfit}
\alias{profPart.rate.interestProfit}
\alias{profPart.rate.interestProfit2}
\alias{profPart.rate.interestProfitPlusGuarantee}
\alias{profPart.rate.riskProfit}
\alias{profPart.rate.sumProfit}
\alias{profPart.rate.terminalBonus}
......@@ -48,6 +51,8 @@ profPart.rate.sumProfit(rates, params, values, ...)
profPart.rate.terminalBonus(rates, params, values, ...)
profPart.rate.interestProfitPlusGuarantee(rates, params, values, ...)
profPart.rate.totalInterest(rates, params, values, ...)
profPart.rate.totalInterest2(rates, params, values, ...)
......@@ -72,6 +77,12 @@ profPart.benefit.ProfitPlusHalfTotalInterest(profits, rates, params, values)
profPart.benefit.ProfitPlusHalfGuaranteedInterest(profits, rates, params,
values)
profPart.benefit.ProfitPlusInterestMinGuaranteeTotal(profits, rates, params,
values)
profPart.benefit.ProfitPlusHalfInterestMinGuaranteeTotal(profits, rates, params,
values)
profPart.benefit.TerminalBonus5YearsProRata(profits, rates, params, values)
ProfitParticipation
......@@ -103,6 +114,8 @@ reserves).
\item \code{profPart.rate.terminalBonus}: Returns the array of terminal bonus rates (keyed by year)
\item \code{profPart.rate.interestProfitPlusGuarantee}: Rate for interest on past profits: total interest rate
\item \code{profPart.rate.totalInterest}: Rate for interest on past profits: total interest rate
\item \code{profPart.rate.totalInterest2}: Rate for interest on past profits: second total interest rate
......@@ -125,6 +138,10 @@ reserves).
\item \code{profPart.benefit.ProfitPlusHalfGuaranteedInterest}: Calculate death benefit as total profit with (guaranteed) interest for one year
\item \code{profPart.benefit.ProfitPlusInterestMinGuaranteeTotal}: Calculate accrued benefit as total profit with interest for one year (min of guarantee and total interest)
\item \code{profPart.benefit.ProfitPlusHalfInterestMinGuaranteeTotal}: Calculate accrued benefit as total profit with interest for half a year (min of guarantee and total interest)
\item \code{profPart.benefit.TerminalBonus5YearsProRata}: Calculate benefit from terminal bonus as 1/n parts of the terminal bonus reserve during the last 5 years
}}
\keyword{datasets}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment