setCost {LifeInsureR}R Documentation

Update one component of an InsuranceTarif's cost structure

Description

Insurance tariff costs are defined by a cost matrix with dimensions: {CostType, Basis, Period}, where:

CostType:

alpha, Zillmer, beta, gamma, gamma_nopremiums, unitcosts

Basis:

SumInsured, SumPremiums, GrossPremium, NetPremium, Constant

Period:

once, PremiumPeriod, PremiumFree, PolicyPeriod, AfterDeath, FullContract

After creation (using the function initializeCosts()), the funciton setCost can be used to modify a single entry. While initializeCosts() provides arguments to set the most common types of cost parameters in one call, the setCost function allows to modify any cost parameter.

Usage

setCost(costs, type, basis = "SumInsured", frequency = "PolicyPeriod", value)

Arguments

costs

The cost definition matrix (usually created by initializeCosts())

type

The cost type (alpha, Zillmer, beta, gamma, gamma_nopremiums, unitcosts)

basis

The basis fo which the cost rate is applied (default is SumInsured)

frequency

How often / during which period the cost is charged (once, PremiumPeriod, PremiumFree, PolicyPeriod, FullContract)

value

The new cost value to set for the given type, basis and frequency

Details

This function modifies a copy of the cost structure and returns it, so this function can be chained as often as desired and final return value will contain all cost modifications.

Value

The modified cost structure

Examples

costs = initializeCosts()
setCost(costs, "alpha", "SumPremiums", "once", 0.05)


[Package LifeInsureR version 1.0.0 Index]