View source: R/InsuranceParameters.R
setCost | R Documentation |
Insurance tariff costs are defined by a cost matrix with dimensions: CostType, Basis, Period, where:
alpha, Zillmer, beta, gamma, gamma_nopremiums, unitcosts
SumInsured, SumPremiums, GrossPremium, NetPremium, Constant
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.
setCost(costs, type, basis = "SumInsured", frequency = "PolicyPeriod", value)
costs |
The cost definition matrix (usually created by |
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 |
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.
The modified cost structure
costs = initializeCosts() setCost(costs, "alpha", "SumPremiums", "once", 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.