View source: R/model_refinement.R
| add_relativities | R Documentation |
Splits an existing model variable into more detailed tariff segments using supplied relativities. This is useful when the GLM is fitted on a coarser rating factor for credibility or stability, but the final tariff needs a more detailed split that is based on portfolio exposure, expert judgement or externally agreed relativities.
add_relativities(
model,
model_variable,
split_variable,
relativities,
exposure,
normalize = TRUE
)
model |
Object of class |
model_variable |
Character string. Existing variable in the GLM, or a
restricted version created by an earlier |
split_variable |
Character string. More granular portfolio variable that
defines the detailed groups inside |
relativities |
Named list of data frames, usually created with
|
exposure |
Character string. Exposure column used for weighting and, when requested, normalisation. |
normalize |
Logical. If |
model_variable is the variable already used in the GLM. split_variable is
the more detailed variable in the portfolio data that will be used to split
one or more levels of model_variable. The relativities argument should be
a named list describing those splits, usually built with relativities() and
split_level().
The step is stored on the rating_refinement object and is applied when
refit() is called. When normalize = TRUE, the supplied relativities are
normalised using exposure so that the refined split keeps the original level
effect on average. This helps prevent an expert split from unintentionally
changing the total premium level for the original model group.
If model_variable was restricted in an earlier add_restriction() step,
the restricted coefficients are automatically used as the basis for the
derived relativities. The user can continue to supply the original model
variable; no additional argument is needed. Supplying the restricted
variable explicitly gives the same coefficient basis and does not apply the
restriction a second time. Refinement steps are order-dependent, so a
restriction added after add_relativities() does not affect an earlier
relativity step. Once the restricted coefficients have been used to derive
the final split, rating_table() reports the split_variable as the tariff
factor and does not also show the intermediate restricted variable.
When to use
add_relativities() is intended for refinement within an already reasonably
homogeneous GLM segment. It redistributes an existing coefficient across
sublevels using exposure-weighted relativities, while preserving the overall
level of the original coefficient. This is useful for mild heterogeneity,
commercial refinement, monotonic tariff differentiation, or expert-based
segmentation within a stable risk group where the original GLM coefficient is
broadly representative.
Limitations
The method is not a substitute for creating a separate risk segment when the original GLM coefficient is itself distorted. For example, suppose a broad industry segment contains many relatively stable businesses, but a few chemical companies drive most of the losses while representing little exposure. The fitted industry coefficient may then be dominated by the chemical companies' experience. Applying exposure-weighted relativities inside that segment may barely reduce the coefficient for the large exposure group, because the original coefficient is already pulled upward by the outlier subgroup.
In that situation it is often better to create a separate GLM factor level,
derive a separate tariff segment, or apply explicit segmentation or
acceptation rules, instead of relying only on add_relativities().
Object of class rating_refinement.
Martin Haringa
portfolio <- data.frame(
claims = c(1, 2, 1, 3, 2, 4),
exposure = rep(1, 6),
construction = factor(c("residential", "commercial", "residential",
"commercial", "residential", "commercial")),
construction_detail = factor(c("flat", "shop", "house",
"office", "flat", "shop"))
)
model <- glm(
claims ~ construction + offset(log(exposure)),
family = poisson(),
data = portfolio
)
relativities <- relativities(
split_level(
"residential",
new_levels = c("flat", "house"),
relativities = c(0.95, 1.05)
),
split_level(
"commercial",
new_levels = c("shop", "office"),
relativities = c(1.10, 0.90)
)
)
refined <- prepare_refinement(model, data = portfolio) |>
add_relativities(
model_variable = "construction",
split_variable = "construction_detail",
relativities = relativities,
exposure = "exposure"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.