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

More documentation work...

parent c28b42fd
No related branches found
No related tags found
No related merge requests found
......@@ -489,6 +489,8 @@ InsuranceContract.ParametersFill = function(params = InsuranceContract.Parameter
#' will be filled with the corresponding entry from \code{fallback}.
#' @param fallback Fallback values that will be used when the corresponding
#' entry in \code{params} is NULL.
#' @param ppParameters Whether profit participation parameters should also be
#' filled (default is TRUE)
#'
#' @export
InsuranceContract.ParametersFallback = function(params, fallback, ppParameters = TRUE) {
......
......@@ -6,6 +6,13 @@ NULL
# Shut up the package checker:
# if (getRversion() >= "2.15.1") utils::globalVariables(c("profitClass"))
#' Filter the whole data.frame of profit rates for the given profit classes
#'
#' This is a rather trivial helper function, which just calls [dplyr::filter()].
#'
#' @param rates data.frame containing all profit rates for multiple profit classes
#' @param classes the profit classes, for which rates should be extracted
#'
#' @export
filterProfitRates = function(rates, classes) {
dplyr::filter(.data = rates, .data$profitClass %in% classes)
......
......@@ -16,6 +16,11 @@ NULL
#' scheme and the contract)
#' @param values Contract values calculated so far (guaranteed component of the
#' insurance contract, including cash flows, premiums, reserves etc.).
#' @param ... Other values that might be used for the calculation (currently unused)
#'
#' @param base The profit calculation base, on which the rate is to be applied
#' @param rate The profit participation rate
#' @param waiting A possible waiting period
NULL
shiftBy = function(rate, n = 1) {
......@@ -91,6 +96,8 @@ PP.base.sumInsured = function(rates, params, values, ...) {
#' @describeIn ProfitParticipationFunctions
#' Basis for Terminal Bonus Fund Assignment: total profit assignment of the year
#'
#' @param res the data.frame of reserves.
#' @export
PP.base.totalProfitAssignment = function(res, ...) {
res[,"totalProfitAssignment"]
......@@ -180,6 +187,13 @@ PP.rate.interestProfit2 = function(rates, ...) {
# TODO
#' @describeIn ProfitParticipationFunctions
#'
#' Calculate the terminal bonus reserve.
#' @param profits The data.frame of profits assigned
#' @param terminalBonus The terminal bonus calculated
#' @param terminalBonusAccount The terminal bonus account (like a bank account,
#' where terminal bonuses are accrued, potentiall discounted from the maturity)
getTerminalBonusReserve = function(profits, rates, terminalBonus, terminalBonusAccount, params, values, ...) {
n = length(terminalBonusAccount)
terminalBonusAccount * 1/(1.07) ^ ((n - 1):0)
......
......@@ -12,6 +12,9 @@ will be filled with the corresponding entry from \code{fallback}.}
\item{fallback}{Fallback values that will be used when the corresponding
entry in \code{params} is NULL.}
\item{ppParameters}{Whether profit participation parameters should also be
filled (default is TRUE)}
}
\description{
Provide default values for the insurance contract parameters if any of the
......
......@@ -22,6 +22,7 @@
\alias{PP.rate.totalInterest}
\alias{PP.rate.totalInterest2}
\alias{PP.rate.interestProfit2}
\alias{getTerminalBonusReserve}
\alias{PP.calculate.RateOnBase}
\alias{PP.calculate.RateOnBaseMin0}
\alias{PP.calculate.RatePlusGuaranteeOnBase}
......@@ -80,6 +81,16 @@ PP.rate.totalInterest2(rates, ...)
PP.rate.interestProfit2(rates, ...)
getTerminalBonusReserve(
profits,
rates,
terminalBonus,
terminalBonusAccount,
params,
values,
...
)
PP.calculate.RateOnBase(base, rate, waiting, rates, params, values, ...)
PP.calculate.RateOnBaseMin0(base, rate, waiting, rates, params, values, ...)
......@@ -137,6 +148,23 @@ scheme and the contract)}
\item{values}{Contract values calculated so far (guaranteed component of the
insurance contract, including cash flows, premiums, reserves etc.).}
\item{...}{Other values that might be used for the calculation (currently unused)}
\item{res}{the data.frame of reserves.}
\item{profits}{The data.frame of profits assigned}
\item{terminalBonus}{The terminal bonus calculated}
\item{terminalBonusAccount}{The terminal bonus account (like a bank account,
where terminal bonuses are accrued, potentiall discounted from the maturity)}
\item{base}{The profit calculation base, on which the rate is to be applied}
\item{rate}{The profit participation rate}
\item{waiting}{A possible waiting period}
}
\description{
Various helper functions for the \code{ProfitParticipation} class that
......@@ -185,6 +213,8 @@ the rates and how the assigned profit is calculated.
\item \code{PP.rate.interestProfit2}: Rate for interest on past profits: second interest profit rate (not including guaranteed interest), keyed by year
\item \code{getTerminalBonusReserve}: Calculate the terminal bonus reserve.
\item \code{PP.calculate.RateOnBase}: Calculate profit by a simple rate applied on the basis (with an optional waiting vector of values 0 or 1)
\item \code{PP.calculate.RateOnBaseMin0}: Calculate profit by a simple rate applied on the basis (with an optional waiting vector of values 0 or 1), bound below by 0
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ProfitParticipation.R
\name{filterProfitRates}
\alias{filterProfitRates}
\title{Filter the whole data.frame of profit rates for the given profit classes}
\usage{
filterProfitRates(rates, classes)
}
\arguments{
\item{rates}{data.frame containing all profit rates for multiple profit classes}
\item{classes}{the profit classes, for which rates should be extracted}
}
\description{
This is a rather trivial helper function, which just calls \code{\link[dplyr:filter]{dplyr::filter()}}.
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment