Learn R Programming

The LifeInsuranceContracts Package For Traditional Life Insurance with Guarantee and Profit Participation

R package implementing general life insurance contracts

This package R6 classes to model traditional life insurance contracts like annuities, whole life insurances or endowments. All relevant quantities like premium decomposition, reserves and benefits over the whole contract period are calculated and potentially exported to excel. Mortalities are given using the MortalityTables package.

Copy Link

Version

Install

install.packages('LifeInsuranceContracts')

Monthly Downloads

720

Version

0.0.4

License

GPL (>= 2)

Maintainer

Reinhold Kainhofer

Last Published

September 11th, 2022

Functions in LifeInsuranceContracts (0.0.4)

InsuranceContract.ParametersFallback

Use fallback values for missing contract parameters
InsuranceContract.ParametersFill

Initialize the insurance contract parameters from passed arguments
ProfitComponentsMultipleEnum-class

Enum to define the different components of profit participation.
CalculationSingleEnum-class

Enum to define how much of a contract needs to be calculated automatically.
InsuranceContract.Values

Data structure (filled only with NULL) for insurance contract class member values.
InsuranceContract

Base Class for Insurance Contracts
InsuranceContract.ParameterStructure

Full insurance contract parameter structure.
PaymentTimeSingleEnum-class

Enum to describe when a benefit or premium payment is due (in advance or in arrears)
InsuranceContract.ParameterDefaults

Default parameters for the InsuranceContract class.
InsuranceTarif

Base class for traditional Insurance Tarifs (with fixed guarantee, profit sharing and no unit-linked component)
age.yearDifference

Calculate the age of the insured based on the difference of the bith year and contract closing year.
age.exactRounded

Calculate the age of the insured based on exact age at contract closing, rounded to the nearest birthday.
costs.baseAlpha

Helper function to define base costs with base alpha, but otherwise unchanged costs
contractGrid

Create a grid of InsuranceContract objects or premiums with each axis representing one varying parameter
SexSingleEnum-class

Enum to describe possible sexes in an insurance contract or tariff.
applyHook

If hook is a function, apply it to val, otherwise return val unchanged
ProfitParticipation

Base Class for Profit Participation Schemes
TariffTypeSingleEnum-class

An enum specifying the main characteristics of the tarif.
costValuesAsDF

Convert the multi-dimensional costs array to a data.frame for output to a file
fallbackFields

Replace missing values in ields by default fallback values
deathBenefit.linearDecreasing

Describes the death benefit of a linearly decreasing whole life insurance (after a possible deferall period)
ProfitParticipationFunctions

Helper functions for profit participation
deathBenefit.annuityDecreasing

Describes the death benefit of a decreasing whole life insurance (after a possible deferall period)
costs.scaleAlpha

Helper function to modify alpha costs of an insurance contract individually
costsDisplayTable

Helper function to display all cost definitions in a concise table
fillFields

Overwrite all existing fields with default values given
freqCharge

Defines a frequency charge (surcharge for monthly/quarterly/semiannual) premium payments
head0

Set all entries of the given vector to 0 up until index 'start'
exportInsuranceContract.xlsx

Export an insurance act object tocontract (object of class InsuranceContract) to an Excel file
setCost

Update one component of an InsuranceTarif's cost structure
vmGlgExample.generateTest

Generate testthat output for unit-testing a tarif implementation
rollingmean

Calculate the rolling mean of length 2
valueOrFunction

If val is a function, evaluate it, otherwise return val
makeContractGridDimname

Create human-readable labels for the dimensions in a contractGrid()
isSinglePremiumContract

Determine whether a contract (given all parameters) is a single-premium contract or with regular premiums
fillNAgaps

Replace all NA entries of a vector with the previous non-NA value
filterProfitRates

Filter the whole data.frame of profit rates for the given profit classes
padLast

Pad the vector v to length l by repeating the last entry of the vector.
pad0

Pad a vector with 0 to a desired length
exportInsuranceContractExample

Export the example calculations of an insurance contract
showVmGlgExamples

Display insurance contract calculation example
testVmGlgExample

Perform unit tests of given standard values of the insurance contract example
initializeCosts

Initialize or modify a data structure for the definition of InsuranceTarif costs
isRegularPremiumContract

Determine whether a contract (given all parameters) is a contract with regular premiums