Skip to contents

Portfolio analysis

Analyse portfolio behaviour and inspect risk factors before model estimation.

factor_analysis()
Factor analysis for discrete risk factors
autoplot(<factor_analysis>)
Automatically create a ggplot for objects obtained from factor analysis
outlier_histogram()
Portfolio histogram with tail bins

Severity and large claims

Analyse claim amounts, capped or truncated severity, and large-loss components that can be added to technical risk premium models.

plot_severity_distribution()
Exploratory severity diagnostics by category
assess_excess_threshold()
Assess possible excess-loss thresholds
autoplot(<excess_threshold_assessment>)
Plot an excess threshold assessment
calculate_excess_loss()
Decompose claim amounts into capped and excess parts
allocate_excess_loss()
Allocate excess loss to a pricing portfolio
autoplot(<excess_loss_allocation>)
Plot an excess-loss allocation
add_excess_loading()
Add excess loading to a pricing portfolio
fit_truncated_severity() experimental
Fit severity distributions to truncated claim data
autoplot(<truncated_severity>)
Plot a fitted truncated severity distribution
rlnormt()
Generate random samples from a truncated lognormal distribution
rgammat()
Generate random samples from a truncated gamma distribution

Tariff segments

Analyse continuous risk factors and convert them to tariff segments.

risk_factor_gam()
Fit a GAM for a continuous risk factor
autoplot(<riskfactor_gam>)
Autoplot for GAM objects from risk_factor_gam()
derive_tariff_segments()
Derive insurance tariff segments
add_tariff_segments()
Add derived tariff segments to portfolio data
autoplot(<tariff_segments>)
Autoplot for tariff segment objects

Modelling and interpretation

Estimate pricing models and interpret fitted coefficients in tariff terms.

rating_table()
Build rating tables from fitted pricing models
add_observed_experience()
Add observed portfolio experience to a rating table
autoplot(<rating_table>)
Plot risk factor effects from rating_table() results
add_prediction()
Add Model Predictions to a Data Frame

Refinement workflow

Apply structured tariff adjustments such as smoothing, restrictions, and relativities.

prepare_refinement()
Prepare a model refinement workflow
autoplot(<rating_refinement>)
Plot a model refinement step
add_smoothing()
Add smoothing to a refinement workflow
edit_smoothing()
Edit an existing smoothing step in a refinement workflow
add_restriction()
Add coefficient restrictions to a refinement workflow
add_relativities()
Add expert-based relativities to a refinement workflow
relativities()
Combine multiple level splits into relativities
split_level()
Define a level split with relativities
split_relativities()
Construct a relativities mapping for level splitting
refit()
Refit a prepared refinement workflow

Validation

Assess model fit, predictive stability, dispersion, and residual behaviour.

model_performance()
Performance of fitted GLMs
rmse()
Root Mean Squared Error (RMSE)
bootstrap_performance()
Bootstrapped model performance
autoplot(<bootstrap_performance>)
Autoplot for bootstrap_performance objects
check_overdispersion()
Check overdispersion of a Poisson claim frequency model
check_residuals()
Check simulation-based model residuals
autoplot(<check_residuals>)
Autoplot for check_residuals objects

Model structure

Extract model data and analyse observed rating-grid combinations.

extract_model_data() experimental
Extract model data
rating_grid()
Construct observed rating-grid points from model data or a data frame

Utilities

Supporting functions used across pricing workflows.

set_reference_level()
Set the reference level of a factor
split_periods_to_months()
Split policy periods into monthly rows
active_rows_by_date()
Find active portfolio rows for event dates
merge_date_ranges()
Reduce portfolio periods by merging adjacent date ranges

Data

MTPL
Motor Third Party Liability (MTPL) portfolio
MTPL2
Motor Third Party Liability (MTPL) portfolio (3,000 policyholders)

Deprecated

Legacy functions retained for backward compatibility. New code should use the updated API.

univariate()
Deprecated alias for factor_analysis()
riskfactor_gam()
Deprecated alias for risk_factor_gam()
fit_gam()
Deprecated NSE wrapper for risk_factor_gam()
rating_factors()
Deprecated alias for rating_table()
rating_factors2() deprecated
Deprecated single-model rating table helper
model_data()
Deprecated alias for extract_model_data()
construct_model_points()
Deprecated alias for rating_grid()
construct_tariff_classes()
Deprecated alias for derive_tariff_segments()
bootstrap_rmse()
Deprecated alias for bootstrap_performance()
fit_truncated_dist()
Deprecated alias for fit_truncated_severity()
fisher_classify()
Fisher's natural breaks classification
fisher()
Deprecated alias for fisher_classify()
histbin()
Deprecated alias for outlier_histogram()
biggest_reference()
Deprecated alias for set_reference_level()
restrict_coef()
Deprecated restriction helper
smooth_coef()
Deprecated smoothing helper
refit_glm()
Deprecated refit wrapper
update_glm()
Deprecated alias for refit_glm()
period_to_months()
Deprecated alias for split_periods_to_months()
rows_per_date()
Deprecated alias for active_rows_by_date()
reduce()
Deprecated alias for merge_date_ranges()