Learn R Programming

The LifeInsureR 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('LifeInsureR')

Monthly Downloads

634

Version

1.0.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Reinhold Kainhofer

Last Published

November 6th, 2023

Functions in LifeInsureR (1.0.0)

InsuranceContract.ParametersFallback

Use fallback values for missing contract parameters
InsuranceContract.Values

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

Initialize the insurance contract parameters from passed arguments
InsuranceContract

Base Class for Insurance Contracts
InsuranceTarif

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

Enum to define how much of a contract needs to be calculated automatically.
PaymentTimeSingleEnum-class

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

PVfactory (R6Class for present values with arbitrary dimensions)
InsuranceContract.ParameterDefaults

Default parameters for the InsuranceContract class.
InsuranceContract.ParameterStructure

Full insurance contract parameter structure.
age.yearDifference

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

Helper functions for profit participation
contractGrid

Create a grid of InsuranceContract objects or premiums with each axis representing one varying parameter
age.exactRounded

Calculate the age of the insured based on exact age at contract closing, rounded to the nearest birthday.
SexSingleEnum-class

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

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

If hook is a function, apply it to val, otherwise return val unchanged
costs.baseAlpha

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

Base Class for Profit Participation Schemes
costsDisplayTable

Helper function to display all cost definitions in a concise table
TariffTypeSingleEnum-class

An enum specifying the main characteristics of the tarif.
ProfitComponentsMultipleEnum-class

Enum to define the different components of profit participation.
exportInsuranceContractExample

Export the example calculations of an insurance contract
fallbackFields

Replace missing values in ields by default fallback values
initializeCosts

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

Set all entries of the given vector to 0 up until index 'start'
costs.scaleAlpha

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

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

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

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

Display insurance contract calculation example
rollingmean

Calculate the rolling mean of length 2
setCost

Update one component of an InsuranceTarif's cost structure
fillFields

Overwrite all existing fields with default values given
fillNAgaps

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

Pad a vector with 0 to a desired length
vmGlgExample.generateTest

Generate testthat output for unit-testing a tarif implementation
makeContractGridDimname

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

If val is a function, evaluate it, otherwise return val
deathBenefit.linearDecreasing

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

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

Export an insurance contract (object of class InsuranceContract) to an 'Excel' file
testVmGlgExample

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

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

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

Default premium refund period: for deferred contracts the deferral period, otherwise the whole contract