exportInsuranceContractExample: Export the example calculations of an insurance contract

View source: R/exportInsuranceContractExample.R

exportInsuranceContractExampleR Documentation

Export the example calculations of an insurance contract

Description

Export the given contract to excel (full history/timeseries of all cash flows, reserves, premiums, etc.) and to a text file (sample calculation required by the Austrian regulation).

Usage

exportInsuranceContractExample(
  contract,
  prf = 10,
  outdir = ".",
  basename = NULL,
  extraname = NULL,
  ...
)

Arguments

contract

The InsuranceContract object to be exported

prf

The time of the premium waiver

outdir

The output directory (the file names are not configurable)

basename

The base output filename (sans .xlsx). If missing, a name of the form 2020-08-01_TARIFNAME_EXTRANAME_RZ0.01_x35_YoB1977_LZ45_PrZ20_VS100000 is used. If given, the main contract without modification will be exported to basename.xlsx, while the example with premium waiver will be exported to basename_PremiumWaiver_t10.xlsx and the text file containing the examples required by the LV-VMGV is exported to basename_VmGlg.txt.

extraname

If basename is not given, this allows a suffix to distinguish multiple exports.

...

Further parameters (passed on to showVmGlgExamples)

Details

Three output files are generated:

  • DATE_TARIFF_Example.xlsx: Full history/timeseries

  • DATE_TARIFF_Example_PremiumWaiver_t10.xlsx: Full history/timeseries after a premium waiver at the given time prf

  • DATE_TARIFF_Examples_VmGlg.txt: Example calculation required for the Austrian regulation (LV-VMGLV)

Examples

library("MortalityTables")
mortalityTables.load("Austria_Annuities_AVOe2005R")
# A trivial deferred annuity tariff with no costs:
tariff = InsuranceTarif$new(name="Test Annuity", type="annuity", tarif = "Annuity 1A",
    mortalityTable = AVOe2005R.unisex, i=0.01)
contract = InsuranceContract$new(
    tariff,
    age = 35, YOB = 1981,
    policyPeriod = 30, premiumPeriod = 15, deferralPeriod = 15,
    sumInsured = 1000,
    contractClosing = as.Date("2016-10-01")
);
## Not run: exportInsuranceContractExample(contract, prf = 10)


kainhofer/r-life-insurance-contracts documentation built on Sept. 18, 2022, 7:56 p.m.