initializeCosts: Initialize or modify a data structure for the definition of...

View source: R/InsuranceParameters.R

initializeCostsR Documentation

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

Description

Initialize 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, CommissionPeriod

This cost structure can then be modified for non-standard costs using the setCost() function. The main purpose of this structure is to be passed to InsuranceContract or InsuranceTarif definitions.

Usage

initializeCosts(
  costs,
  alpha,
  Zillmer,
  alpha.commission,
  beta,
  gamma,
  gamma.paidUp,
  gamma.premiumfree,
  gamma.contract,
  gamma.afterdeath,
  gamma.fullcontract,
  unitcosts,
  unitcosts.PolicyPeriod
)

Arguments

costs

(optional) existing cost structure to duplicate / use as a starting point

alpha

Alpha costs (charged once, relative to sum of premiums)

Zillmer

Zillmer costs (charged once, relative to sum of premiums)

alpha.commission

Alpha costs (charged during the commission period, relative to sum of premiums; Use the commissionPeriod and alphaCostsCommission contract parameters to set the length of the commission period and whether the alpha.commission val´ue is understood as yearly cost or the sum or present value of the commission charges over the whole commission period)

beta

Collection costs (charged on each gross premium, relative to gross premium)

gamma

Administration costs while premiums are paid (relative to sum insured)

gamma.paidUp

Administration costs for paid-up contracts (relative to sum insured)

gamma.premiumfree

Administration costs for planned premium-free period (reltaive to sum insured)

gamma.contract

Administration costs for the whole contract period (relative to sum insured)

gamma.afterdeath

Administration costs after the insured person has dies (for term-fix insurances)

gamma.fullcontract

Administration costs for the full contract period, even if the insured has already dies (for term-fix insurances)

unitcosts

Unit costs (absolute monetary amount, during premium period)

unitcosts.PolicyPeriod

Unit costs (absolute monetary amount, during full contract period)

Examples

# empty cost structure (only 0 costs)
initializeCosts()

# the most common cost types can be given in initializeCosts()
initializeCosts(alpha = 0.04, Zillmer = 0.025, beta = 0.05, gamma.contract = 0.001)

# The same cost structure manually
costs.Bsp = initializeCosts();
costs.Bsp[["alpha", "SumPremiums", "once"]] = 0.04;
costs.Bsp[["Zillmer", "SumPremiums", "once"]] = 0.025;
costs.Bsp[["beta", "GrossPremium", "PremiumPeriod"]] = 0.05;
costs.Bsp[["gamma", "SumInsured", "PolicyPeriod"]] = 0.001;

# The same structure using the setCost() function:
library(magrittr)
costs.Bsp = initializeCosts() %>%
  setCost("alpha", "SumPremiums", "once", 0.04) %>%
  setCost("Zillmer", "SumPremiums", "once", 0.025) %>%
  setCost("beta", "GrossPremium", "PremiumPeriod", 0.05) %>%
  setCost("gamma", "SumInsured", "PolicyPeriod", 0.001)





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