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

Fix policy period for lifelong insurance contracts

parent 8e84ce29
Branches
Tags
No related merge requests found
...@@ -35,7 +35,7 @@ Imports: ...@@ -35,7 +35,7 @@ Imports:
pander, pander,
tidyr tidyr
License: GPL (>= 2) License: GPL (>= 2)
RoxygenNote: 7.2.1 RoxygenNote: 7.2.3
Collate: Collate:
'HelperFunctions.R' 'HelperFunctions.R'
'InsuranceParameters.R' 'InsuranceParameters.R'
......
...@@ -300,8 +300,9 @@ InsuranceTarif = R6Class( ...@@ -300,8 +300,9 @@ InsuranceTarif = R6Class(
age = params$ContractData$technicalAge age = params$ContractData$technicalAge
maxAge = MortalityTables::getOmega(params$ActuarialBases$mortalityTable) maxAge = MortalityTables::getOmega(params$ActuarialBases$mortalityTable)
policyTerm = min(maxAge + 1 - age, params$ContractData$policyPeriod) 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( 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! # 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! # The policy must end AFTER that final year, not at the beginning!
policyTerm = policyTerm, policyTerm = policyTerm,
......
...@@ -1061,13 +1061,13 @@ All premiums, reserves and present values have already been calculated. ...@@ -1061,13 +1061,13 @@ All premiums, reserves and present values have already been calculated.
\subsection{Method \code{calculateFutureSums()}}{ \subsection{Method \code{calculateFutureSums()}}{
Generic function to calculate future sums of the values Generic function to calculate future sums of the values
\subsection{Usage}{ \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}{ \subsection{Arguments}{
\if{html}{\out{<div class="arguments">}} \if{html}{\out{<div class="arguments">}}
\describe{ \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} \item{\code{...}}{currently unused}
} }
...@@ -1081,19 +1081,22 @@ Generic function to calculate future sums of the values ...@@ -1081,19 +1081,22 @@ Generic function to calculate future sums of the values
Calculate all present values for a given time series. The Calculate all present values for a given time series. The
mortalities are taken from the contract's parameters. mortalities are taken from the contract's parameters.
\subsection{Usage}{ \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}{ \subsection{Arguments}{
\if{html}{\out{<div class="arguments">}} \if{html}{\out{<div class="arguments">}}
\describe{ \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} times are desired}
\item{\code{params}}{Contract-specific, full set of parameters of the contract \item{\code{params}}{Contract-specific, full set of parameters of the contract
(merged parameters of the defaults, the tariff, the profit participation (merged parameters of the defaults, the tariff, the profit participation
scheme and the contract)} 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} \item{\code{...}}{currently unused}
} }
\if{html}{\out{</div>}} \if{html}{\out{</div>}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment