diff --git a/DESCRIPTION b/DESCRIPTION index 4dbb540a78bc9fa2d466265d2f35d2d54025ab70..7830ffa1377d1f7b02fdbd38fe0ab3a32eaaa8de 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,7 +35,7 @@ Imports: pander, tidyr License: GPL (>= 2) -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 Collate: 'HelperFunctions.R' 'InsuranceParameters.R' diff --git a/R/InsuranceTarif.R b/R/InsuranceTarif.R index ab1cc1bb85cd784ac0f79adacb78a70a82f53fa9..d8171ad6f39a103f089955f8f62c34ab57db4a4a 100644 --- a/R/InsuranceTarif.R +++ b/R/InsuranceTarif.R @@ -300,8 +300,9 @@ InsuranceTarif = R6Class( age = params$ContractData$technicalAge maxAge = MortalityTables::getOmega(params$ActuarialBases$mortalityTable) policyTerm = min(maxAge + 1 - age, params$ContractData$policyPeriod) + # Length of CF vectors / data.frames is always 1 more than the policy period, since there might be a survival payment at the end! list( - l = min(maxAge +1 - age, policyTerm), + l = policyTerm + 1, # Length of CF vectors (1 larger than policy period!) # maxAge is the last age with a given death probability, so it can be included in the policy term! # The policy must end AFTER that final year, not at the beginning! policyTerm = policyTerm, diff --git a/man/InsuranceTarif.Rd b/man/InsuranceTarif.Rd index 5e66aa62712d8b41f1c55952233dbd50e4af5528..624d5b39a3797865336473b1024c2f237af32be2 100644 --- a/man/InsuranceTarif.Rd +++ b/man/InsuranceTarif.Rd @@ -1061,13 +1061,13 @@ All premiums, reserves and present values have already been calculated. \subsection{Method \code{calculateFutureSums()}}{ Generic function to calculate future sums of the values \subsection{Usage}{ -\if{html}{\out{<div class="r">}}\preformatted{InsuranceTarif$calculateFutureSums(values, ...)}\if{html}{\out{</div>}} +\if{html}{\out{<div class="r">}}\preformatted{InsuranceTarif$calculateFutureSums(cf, ...)}\if{html}{\out{</div>}} } \subsection{Arguments}{ \if{html}{\out{<div class="arguments">}} \describe{ -\item{\code{values}}{The time series, for which future sums at all times are desired} +\item{\code{cf}}{The time series, for which future sums at all times are desired} \item{\code{...}}{currently unused} } @@ -1081,19 +1081,22 @@ Generic function to calculate future sums of the values Calculate all present values for a given time series. The mortalities are taken from the contract's parameters. \subsection{Usage}{ -\if{html}{\out{<div class="r">}}\preformatted{InsuranceTarif$calculatePresentValues(values, params)}\if{html}{\out{</div>}} +\if{html}{\out{<div class="r">}}\preformatted{InsuranceTarif$calculatePresentValues(cf, params, values)}\if{html}{\out{</div>}} } \subsection{Arguments}{ \if{html}{\out{<div class="arguments">}} \describe{ -\item{\code{values}}{The time series, for which future present values at all +\item{\code{cf}}{The time series, for which future present values at all times are desired} \item{\code{params}}{Contract-specific, full set of parameters of the contract (merged parameters of the defaults, the tariff, the profit participation scheme and the contract)} +\item{\code{values}}{Contract values calculated so far (in the \code{contract$Values} +list) then this method is called by the contract object} + \item{\code{...}}{currently unused} } \if{html}{\out{</div>}}