diff --git a/NAMESPACE b/NAMESPACE index fdbfb15421eda79c15c96f8daa5fe24a71b07dbf..208dc1ab8c5a5aa6064f57c653a708b461288508 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -64,6 +64,8 @@ export(fillNAgaps) export(filterProfitRates) export(head0) export(initializeCosts) +export(isRegularPremiumContract) +export(isSinglePremiumContract) export(makeContractGridDimname) export(makeContractGridDimnames) export(pad0) diff --git a/R/HelperFunctions.R b/R/HelperFunctions.R index 9bc9b9b4a12605dfae06fa2f9d10a790ee240c2c..ccc0fba8bcb27ecda6fcf1d564e80f41dfbdfe2e 100644 --- a/R/HelperFunctions.R +++ b/R/HelperFunctions.R @@ -103,10 +103,7 @@ ProfitComponentsEnum = objectProperties::setMultipleEnum("ProfitComponents", #' Determine whether a contract (given all parameters) is a single-premium contract or with regular premiums #' -#' The death benefit will be the full sumInsured for the first year after the -#' deferral period and then decrease linearly to 0 at the end of the policyPeriod. -#' This can be used with the \code{deathBenefit} parameter for insurance -#' contracts, but should not be called directly. +#' Single premium contracts are identified by the parameter \code{premiumPeriod = 1}. #' #' @param params The parameters of the contract. #' @param values Unused by default (already calculated values of the contract) @@ -115,6 +112,17 @@ ProfitComponentsEnum = objectProperties::setMultipleEnum("ProfitComponents", isSinglePremiumContract = function(params, values) { params$ContractData$premiumPeriod <= 1 } +#' Determine whether a contract (given all parameters) is a contract with regular premiums +#' +#' Regular premium contracts are identified by the parameter \code{premiumPeriod > 1}. +#' +#' @param params The parameters of the contract. +#' @param values Unused by default (already calculated values of the contract) +#' +#' @export +isRegularPremiumContract = function(params, values) { params$ContractData$premiumPeriod > 1 } + + #' Describes the death benefit of a linearly decreasing whole life insurance (after a possible deferall period) #' #' The death benefit will be the full sumInsured for the first year after the diff --git a/man/isRegularPremiumContract.Rd b/man/isRegularPremiumContract.Rd new file mode 100644 index 0000000000000000000000000000000000000000..f204dbae4e3ececbeed52762c336f7f5559f80e5 --- /dev/null +++ b/man/isRegularPremiumContract.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/HelperFunctions.R +\name{isRegularPremiumContract} +\alias{isRegularPremiumContract} +\title{Determine whether a contract (given all parameters) is a contract with regular premiums} +\usage{ +isRegularPremiumContract(params, values) +} +\arguments{ +\item{params}{The parameters of the contract.} + +\item{values}{Unused by default (already calculated values of the contract)} +} +\description{ +Regular premium contracts are identified by the parameter \code{premiumPeriod > 1}. +} diff --git a/man/isSinglePremiumContract.Rd b/man/isSinglePremiumContract.Rd index ad07dad0734d2a22bdb08cc0bfe63e65d965c37c..b69cc80c59bb10a46f92e22dd9eb4160c051b5ee 100644 --- a/man/isSinglePremiumContract.Rd +++ b/man/isSinglePremiumContract.Rd @@ -12,8 +12,5 @@ isSinglePremiumContract(params, values) \item{values}{Unused by default (already calculated values of the contract)} } \description{ -The death benefit will be the full sumInsured for the first year after the -deferral period and then decrease linearly to 0 at the end of the policyPeriod. -This can be used with the \code{deathBenefit} parameter for insurance -contracts, but should not be called directly. +Single premium contracts are identified by the parameter \code{premiumPeriod = 1}. }