View source: R/gam_riskfactor.R
| risk_factor_gam | R Documentation |
Estimate the relationship between a continuous risk factor and claim frequency, average severity or risk premium with a generalized additive model (GAM). The fitted curve is intended for exploratory risk-factor analysis before selecting a functional form, applying refinement or deriving categorical tariff segments.
risk_factor_gam(
data,
risk_factor = NULL,
claim_count = NULL,
exposure = NULL,
claim_amount = NULL,
pure_premium = NULL,
model = "frequency",
round_risk_factor = NULL,
x = NULL,
nclaims = NULL,
amount = NULL,
round_x = NULL
)
data |
A data frame containing portfolio observations. |
risk_factor |
Character string. Numeric continuous risk-factor column
in |
claim_count |
Character string. Claim-count column. Required for
|
exposure |
Character string. Exposure column used as an offset or aggregation weight. |
claim_amount |
Optional character string. Total claim-amount column.
Required for |
pure_premium |
Optional character string. Row-level risk-premium column.
Required for |
model |
Character string. Response context: |
round_risk_factor |
Optional positive numeric value. The continuous risk factor is rounded to multiples of this value before aggregation and model fitting. This can reduce computation and local volatility when the variable has many distinct values, but it also removes detail. |
x, nclaims, amount, round_x |
Deprecated argument names. Use |
"frequency" fits a Poisson GAM to aggregated claim counts with
log(exposure) as offset.
"severity" fits a Gamma GAM with log link to average claim amount. The
response is total claim amount divided by claim count and claim count is
used as model weight.
"pure_premium" fits a Gamma GAM with log link to exposure-weighted risk
premium.
Observations are first aggregated by the risk-factor value after optional rounding. Predictions and pointwise confidence intervals are then evaluated over the observed range.
The fitted curve describes the marginal pattern in the selected portfolio data. It can reveal non-linearity, broad turning points and areas with sparse support, but it is not by itself a final tariff structure. Correlation with other risk factors, exposure concentration, claim volume, tail observations and stability across periods should be considered before using the pattern in a multivariate GLM.
autoplot.riskfactor_gam() can be used to inspect the curve and observed
experience. derive_tariff_segments() can subsequently translate the smooth
pattern into candidate intervals. Alternatively, add_smoothing() supports
smoothing within the structured refinement workflow.
Column names are supplied as character strings. Deprecated fit_gam() and
riskfactor_gam() interfaces remain available for compatibility.
A list of class "risk_factor_gam" with compatibility classes
"riskfactor_gam" and "fitgam". It contains:
Prediction grid with fitted values and pointwise confidence limits.
Name of the continuous risk factor.
Response context: "frequency", "severity" or
"pure_premium".
Aggregated observed experience and fitted values at observed risk-factor values.
Risk-factor values in the original portfolio row order, after optional rounding.
Rounding increment used for the risk factor, or
NULL when no rounding was applied.
Martin Haringa
Antonio, K. and Valdez, E. A. (2012). Statistical concepts of a priori and a posteriori risk classification in insurance. Advances in Statistical Analysis, 96(2):187–224.
Henckaerts, R., Antonio, K., Clijsters, M. and Verbelen, R. (2018). A data driven binning strategy for the construction of insurance tariff classes. Scandinavian Actuarial Journal, 2018:8, 681–705.
Wood, S.N. (2011). Fast stable restricted maximum likelihood and marginal likelihood estimation of semiparametric generalized linear models. Journal of the Royal Statistical Society (B) 73(1):3–36.
autoplot.riskfactor_gam(), derive_tariff_segments(),
add_smoothing()
age_frequency <- risk_factor_gam(
MTPL,
risk_factor = "age_policyholder",
claim_count = "nclaims",
exposure = "exposure",
model = "frequency"
)
autoplot(age_frequency, show_observations = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.