vmGlgExample.generateTest {LifeInsureR} | R Documentation |
Generate testthat output for unit-testing a tarif implementation
Description
This function calculates the required reference values for the given insurance contract as required by the Austrian regulation (LV-VMGLV, "LV Versicherungsmathematische Grundlagen Verordnung") and generates the code for unit-testing the contract with these values. The code printed can be directly copied into a unit test file.
Usage
vmGlgExample.generateTest(contract, prf = 10, t = 10, t_prf = 12, ...)
Arguments
contract |
The insurance contract to calculate and generate unit-testing code. If an InsuranceTarif object is given, a new contract with default values is generated. |
prf |
Time of premium waiver (premium-free) |
t |
Time for which to calculate all values (except premium-free values) |
t_prf |
Time for which to calculated all values after the premium waiver |
... |
Further parameters for generating the contract for a tariff object |
Value
None (code is printed to the console, but no value returned)
Examples
library(MortalityTables)
mortalityTables.load("Austria_Annuities_AVOe2005R")
# A trivial deferred annuity tariff with no costs:
tariff = InsuranceTarif$new(name="Test Annuity", type="annuity",
mortalityTable = AVOe2005R.unisex, i=0.01)
vmGlgExample.generateTest(tariff,
age = 35, YOB = 1981,
policyPeriod = 30, premiumPeriod = 15, deferralPeriod = 15,
sumInsured = 1000,
contractClosing = as.Date("2016-10-01")
)