Learn R Programming

⚠️There's a newer version (0.0.4) of this package.Take me there.

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.2

License

GPL (>= 2)

Maintainer

Reinhold Kainhofer

Last Published

September 22nd, 2020

Functions in LifeInsuranceContracts (0.0.2)

CalculationSingleEnum-class

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

Full insurance contract parameter structure.
ProfitComponentsMultipleEnum-class

Enum to define the different components of profit participation.
InsuranceContract.ParametersFill

InsuranceContract.ParametersFill
InsuranceContract.ParametersFallback

InsuranceContract.ParametersFallback
InsuranceTarif

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

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

Base Class for Insurance Contracts
InsuranceContract.Values

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

Default parameters for the InsuranceContract class. A new contract will be pre-filled with these values, and values passed in the constructor (or with other setter functions) will override these values.
exportInsuranceContract.xlsx

SexSingleEnum-class

Enum to describe possible sexes in an insurance contract or tariff.
TariffTypeSingleEnum-class

An enum specifying the main characteristics of the tarif. Possible values are:
annuity

Whole life or term annuity (periodic survival benefits) with flexible payouts (constand, increasing, decreasing, arbitrary, etc.)

wholelife

A whole or term life insurance with only death benefits. The benefit can be constant, increasing, decreasing, described by a function, etc.

endowment

An endowment with death and survival benefits, potentially with different benefits.

pureendowment

A pure endowment with only a survival benefit at the end of the contract. Optionally, in case of death, all or part of the premiums paid may be refunded.

terme-fix

A terme-fix insurance with a fixed payout at the end of the contract, even if the insured dies before that time. Premiums are paid until death of the insured.

dread-disease

A dread-disease insurance, which pays in case of a severe illness (typically heart attacks, cancer, strokes, etc.), but not in case of death.

endowment + dread-disease

A combination of an endowment and a temporary dread-disease insurance. Benefits occur either on death, severe illness or survival, whichever comes first.

exportInsuranceContractExample

Export the example calculations of an insurance contract
deathBenefit.linearDecreasing

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

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

Base Class for Profit Participation Schemes
fallbackFields

Replace all missing values in fields (either missing or NA) with their corresponding values from fallback. Members in fallback that are missing in fields are inserted
applyHook

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

Create a grid of InsuranceContract objects or premiums with each axis representing one varying parameter
makeContractGridDimname

initializeCosts

head0

Set all entries of the given vector to 0 up until index 'start'
showVmGlgExamples

Display insurance contract calculation example
valueOrFunction

If val is a function, evaluate it, otherwise return val
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
fillFields

Overwrite all existing fields in the first argument with values given in valuelist. Members of valuelist that are not yet in fields are ignored. This allows a huge valuelist to be used to fill fields in multiple lists with given structure.
ProfitParticipationFunctions

Helper functions for profit participation
pad0

Pad a vector with 0 to a desired length
rollingmean

Calculate the rolling mean of length 2
padLast

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