Package: LifeInsureR 1.0.0

LifeInsureR: Modelling Traditional Life Insurance Contracts

R6 classes to model traditional life insurance contracts like annuities, whole life insurances or endowments. Such life insurance contracts provide a guaranteed interest and are not directly linked to the performance of a particular investment vehicle, but they typically provide (discretionary) profit participation. This package provides a framework to model such contracts in a very generic (cash-flow-based) way and includes modelling profit participation schemes, dynamic increases or more general contract layers, as well as contract changes (like sum increases or premium waivers). All relevant quantities like premium decomposition, reserves and benefits over the whole contract period are calculated and potentially exported to 'Excel'. Mortality rates are given using the 'MortalityTables' package.

Authors:Reinhold Kainhofer [aut, cre, cph]

LifeInsureR_1.0.0.tar.gz
LifeInsureR_1.0.0.zip(r-4.5)LifeInsureR_1.0.0.zip(r-4.4)LifeInsureR_1.0.0.zip(r-4.3)
LifeInsureR_1.0.0.tgz(r-4.4-any)LifeInsureR_1.0.0.tgz(r-4.3-any)
LifeInsureR_1.0.0.tar.gz(r-4.5-noble)LifeInsureR_1.0.0.tar.gz(r-4.4-noble)
LifeInsureR_1.0.0.tgz(r-4.4-emscripten)LifeInsureR_1.0.0.tgz(r-4.3-emscripten)
LifeInsureR.pdf |LifeInsureR.html
LifeInsureR/json (API)
NEWS

# Install 'LifeInsureR' in R:
install.packages('LifeInsureR', repos = c('https://kainhofer.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/kainhofer/lifeinsurer/issues

On CRAN:

3.78 score 2 stars 1 packages 9 scripts 563 downloads 85 exports 73 dependencies

Last updated 12 months agofrom:a7ec545752. Checks:ERROR: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesFAILNov 01 2024
R-4.5-winWARNINGNov 01 2024
R-4.5-linuxWARNINGNov 01 2024
R-4.4-winWARNINGNov 01 2024
R-4.4-macWARNINGNov 01 2024
R-4.3-winWARNINGNov 01 2024
R-4.3-macWARNINGNov 01 2024

Exports:age.exactRoundedage.yearDifferenceapplyHookCalculationEnumcontractGridcontractGridPremiumcosts.baseAlphacosts.scaleAlphacostsDisplayTabledeathBenefit.annuityDecreasingdeathBenefit.linearDecreasingexportInsuranceContract.xlsxexportInsuranceContractExamplefallbackFieldsfillFieldsfillNAgapsfilterProfitRatesfreqChargehead0initializeCostsInsuranceContractInsuranceContract.ParameterDefaultsInsuranceContract.ParametersFallbackInsuranceContract.ParametersFillInsuranceContract.ParameterStructureInsuranceContract.ValuesInsuranceTarifisRegularPremiumContractisSinglePremiumContractmakeContractGridDimnamemakeContractGridDimnamespad0padLastPaymentTimeEnumPP.base.contractualReservePP.base.meanContractualReservePP.base.NULLPP.base.previousContractualReservePP.base.PreviousZillmerReservePP.base.sumInsuredPP.base.totalProfitAssignmentPP.base.ZillmerReserveT2PP.base.ZillmerRiskPremiumPP.benefit.NonePP.benefit.ProfitPP.benefit.ProfitGuaranteeSupportingPP.benefit.ProfitPlusGuaranteedInterestPP.benefit.ProfitPlusHalfGuaranteedInterestPP.benefit.ProfitPlusHalfInterestMinGuaranteeTotalPP.benefit.ProfitPlusHalfTotalInterestPP.benefit.ProfitPlusInterestMinGuaranteeTotalPP.benefit.ProfitPlusTerminalBonusReservePP.benefit.ProfitPlusTotalInterestPP.benefit.TerminalBonusPP.benefit.TerminalBonus5YearsPP.benefit.TerminalBonus5YearsProRataPP.calculate.RateOnBasePP.calculate.RateOnBaseMin0PP.calculate.RateOnBaseSGFFactorPP.calculate.RatePlusGuaranteeOnBasePP.rate.expenseProfitPP.rate.interestProfitPP.rate.interestProfit2PP.rate.interestProfit2PlusGuaranteePP.rate.interestProfitPlusGuaranteePP.rate.riskProfitPP.rate.sumProfitPP.rate.terminalBonusPP.rate.terminalBonusFundPP.rate.totalInterestPP.rate.totalInterest2premiumRefundPeriod.defaultProfitComponentsEnumProfitParticipationPVfactoryrollingmeanRoundingHelpersetCostSexEnumshowVmGlgExamplessumProfitsTariffTypeEnumtestVmGlgExamplevalueOrFunctionvmGlgExample.generateTest

Dependencies:abindbase64encbslibcachemclicolorspacecpp11digestdplyrevaluatefansifarverfastmapfontawesomefsgenericsggplot2gluegtablehighrhtmltoolsisobandjquerylibjsonlitekableExtraknitrlabelinglatticelifecyclelubridatemagrittrMASSMatrixmemoisemgcvmimeMortalityTablesmunsellnlmeobjectPropertiesobjectSignalsopenxlsxpanderpillarpkgconfigpracmapurrrR6rappdirsRColorBrewerRcpprlangrmarkdownrstudioapisassscalesstringistringrsvglitesystemfontstibbletidyrtidyselecttimechangetinytexutf8vctrsviridisLitewithrxfunxml2yamlzip

Readme and manuals

Help Manual

Help pageTopics
Calculate the age of the insured based on exact age at contract closing, rounded to the nearest birthday.age.exactRounded
Calculate the age of the insured based on the difference of the bith year and contract closing year.age.yearDifference
If 'hook' is a function, apply it to 'val', otherwise return 'val' unchangedapplyHook
Enum to define how much of a contract needs to be calculated automatically.CalculationEnum CalculationSingleEnum-class
Create a grid of InsuranceContract objects or premiums with each axis representing one varying parametercontractGrid contractGridPremium
Helper function to define base costs with base alpha, but otherwise unchanged costscosts.baseAlpha
Helper function to modify alpha costs of an insurance contract individuallycosts.scaleAlpha
Helper function to display all cost definitions in a concise tablecostsDisplayTable
Convert the multi-dimensional costs array to a data.frame for output to a filecostValuesAsDF
Describes the death benefit of a decreasing whole life insurance (after a possible deferall period)deathBenefit.annuityDecreasing
Describes the death benefit of a linearly decreasing whole life insurance (after a possible deferall period)deathBenefit.linearDecreasing
Export an insurance contract (object of class InsuranceContract) to an 'Excel' fileexportInsuranceContract.xlsx
Export the example calculations of an insurance contractexportInsuranceContractExample
Replace missing values in ields by default fallback valuesfallbackFields
Overwrite all existing fields with default values givenfillFields
Replace all 'NA' entries of a vector with the previous non-NA valuefillNAgaps
Filter the whole data.frame of profit rates for the given profit classesfilterProfitRates
Defines a frequency charge (surcharge for monthly/quarterly/semiannual) premium paymentsfreqCharge
Set all entries of the given vector to 0 up until index 'start'head0
Initialize or modify a data structure for the definition of InsuranceTarif costsinitializeCosts
Base Class for Insurance ContractsInsuranceContract
Default parameters for the InsuranceContract class.InsuranceContract.ParameterDefaults
Use fallback values for missing contract parametersInsuranceContract.ParametersFallback
Initialize the insurance contract parameters from passed argumentsInsuranceContract.ParametersFill
Full insurance contract parameter structure.InsuranceContract.ParameterStructure
Data structure (filled only with NULL) for insurance contract class member values.InsuranceContract.Values
Base class for traditional Insurance Tarifs (with fixed guarantee, profit sharing and no unit-linked component)InsuranceTarif
Determine whether a contract (given all parameters) is a contract with regular premiumsisRegularPremiumContract
Determine whether a contract (given all parameters) is a single-premium contract or with regular premiumsisSinglePremiumContract
Create human-readable labels for the dimensions in a 'contractGrid()'makeContractGridDimname makeContractGridDimnames
Pad a vector with 0 to a desired lengthpad0
Pad the vector 'v' to length 'l' by repeating the last entry of the vector.padLast
Enum to describe when a benefit or premium payment is due (in advance or in arrears)PaymentTimeEnum PaymentTimeSingleEnum-class
Default premium refund period: for deferred contracts the deferral period, otherwise the whole contractpremiumRefundPeriod.default
Enum to define the different components of profit participation.ProfitComponentsEnum ProfitComponentsMultipleEnum-class
Base Class for Profit Participation SchemesProfitParticipation
Helper functions for profit participationgetTerminalBonusReserve PP.base.contractualReserve PP.base.meanContractualReserve PP.base.NULL PP.base.previousContractualReserve PP.base.PreviousZillmerReserve PP.base.sumInsured PP.base.totalProfitAssignment PP.base.ZillmerReserveT2 PP.base.ZillmerRiskPremium PP.benefit.None PP.benefit.Profit PP.benefit.ProfitGuaranteeSupporting PP.benefit.ProfitPlusGuaranteedInterest PP.benefit.ProfitPlusHalfGuaranteedInterest PP.benefit.ProfitPlusHalfInterestMinGuaranteeTotal PP.benefit.ProfitPlusHalfTotalInterest PP.benefit.ProfitPlusInterestMinGuaranteeTotal PP.benefit.ProfitPlusTerminalBonusReserve PP.benefit.ProfitPlusTotalInterest PP.benefit.TerminalBonus PP.benefit.TerminalBonus5Years PP.benefit.TerminalBonus5YearsProRata PP.calculate.RateOnBase PP.calculate.RateOnBaseMin0 PP.calculate.RateOnBaseSGFFactor PP.calculate.RatePlusGuaranteeOnBase PP.rate.expenseProfit PP.rate.interestProfit PP.rate.interestProfit2 PP.rate.interestProfit2PlusGuarantee PP.rate.interestProfitPlusGuarantee PP.rate.riskProfit PP.rate.sumProfit PP.rate.terminalBonus PP.rate.terminalBonusFund PP.rate.totalInterest PP.rate.totalInterest2 ProfitParticipationFunctions sumProfits
PVfactory (R6Class for present values with arbitrary dimensions)PVfactory
Calculate the rolling mean of length 2rollingmean
Helper object to define rounding rules for the InsuranceContract, InsuranceTarif and ProfitParticipation classes.RoundingHelper
Update one component of an InsuranceTarif's cost structuresetCost
Enum to describe possible sexes in an insurance contract or tariff.SexEnum SexSingleEnum-class
Display insurance contract calculation exampleshowVmGlgExamples
An enum specifying the main characteristics of the tarif.TariffTypeEnum TariffTypeSingleEnum-class
Perform unit tests of given standard values of the insurance contract exampletestVmGlgExample
If 'val' is a function, evaluate it, otherwise return 'val'valueOrFunction
Generate testthat output for unit-testing a tarif implementationvmGlgExample.generateTest