Skip to contents

Portfolio analysis

Inspect observed portfolio experience, exposure distributions and unusual observations before or alongside modelling.

factor_analysis()
Summarise observed portfolio experience by risk factor
autoplot(<factor_analysis>)
Plot observed portfolio experience by risk factor
outlier_histogram()
Portfolio histogram with tail bins

Risk-factor analysis and structuring

Analyse continuous risk relationships and translate them into practical tariff structures.

risk_factor_gam()
Estimate a smooth effect for a continuous risk factor
autoplot(<tariff_segments>) autoplot(<riskfactor_gam>)
Inspect smooth risk-factor effects and tariff-segment boundaries
derive_tariff_segments()
Derive candidate tariff segments from a smooth risk-factor effect
fisher_classify()
Fisher's natural breaks classification
add_tariff_segments()
Add derived tariff segments to portfolio data

Severity modelling

Explore claim amounts and fit severity distributions to truncated claims.

plot_severity_distribution()
Exploratory severity diagnostics by category
fit_truncated_severity()
Fit severity distributions to truncated claim data
autoplot(<truncated_severity>)
Plot a fitted truncated severity distribution

Large-loss treatment

Assess excess thresholds and redistribute large-loss experience for severity or risk-premium modelling.

assess_excess_threshold()
Assess possible excess-loss thresholds
redistribute_excess_loss()
Redistribute large losses for severity or risk-premium modelling

Model interpretation

Interpret fitted pricing models, compare estimated effects with observed portfolio experience, and add model predictions to portfolio data.

rating_table()
Present fitted pricing-model effects as a rating table
add_portfolio_experience()
Add portfolio experience to a rating table
autoplot(<rating_table>)
Compare fitted risk-factor effects graphically
premium_change() as_gt(<premium_change>)
Interpret the premium effect of a smoothing curve
add_prediction()
Add model predictions to a pricing data set

Tariff refinement

Record, inspect and refit explicit actuarial adjustments to tariff relativities.

prepare_refinement()
Prepare a model refinement workflow
add_smoothing()
Smooth grouped tariff relativities in a refinement workflow
edit_smoothing()
Edit a smoothing curve in a refinement workflow
add_restriction()
Add coefficient restrictions to a refinement workflow
add_shrinkage()
Shrink categorical tariff relativities towards a common level
add_rebasing()
Rebase categorical tariff relativities to a reference level
add_relativities()
Add sublevel relativities to a refinement workflow
split_level() relativities()
Define sublevel relativity specifications
autoplot(<rating_refinement>)
Inspect a model refinement step
refit()
Fit a prepared refinement specification
calibrate_model()
Calibrate the overall level of a refined pricing model
audit_refinement()
Audit the effect of a fitted model refinement

Model validation

Assess model performance, resampling stability, distributional assumptions and residual behaviour.

model_performance()
Compare fitted GLMs using common performance measures
bootstrap_performance()
Assess performance stability under repeated resampling
autoplot(<bootstrap_performance>)
Plot the resampled performance distribution
bootstrap_coefficients()
Assess GLM coefficient stability by portfolio-row bootstrap
check_overdispersion()
Check overdispersion of a Poisson claim frequency model
check_residuals()
Check simulation-based model residuals
autoplot(<check_residuals>)
Inspect simulation-based residual uniformity

Portfolio preparation and reduction

Consolidate policy periods and aggregate observed model points in memory or lazily in a database.

merge_date_ranges()
Reduce portfolio periods by merging adjacent date ranges
merge_date_ranges_db()
Merge connected portfolio periods in DuckDB
rating_grid()
Construct observed rating-grid points
rating_grid_db()
Reduce a database portfolio to observed rating-grid points

Policy period operations

Split, align and query insurance policy periods over time.

split_periods_to_months()
Split portfolio periods into calendar months
active_rows_by_date()
Match event dates to active portfolio periods

Model and supporting utilities

Recover model data, format package results and support common pricing calculations and simulations.

extract_model_data()
Recover the portfolio data used by a fitted model
as_gt()
Convert an object to a gt table
set_reference_level()
Set the reference level of a factor
rmse()
Calculate response-scale prediction error
rlnormt()
Simulate severities from a truncated lognormal distribution
rgammat()
Simulate severities from a truncated gamma distribution

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
add_observed_experience()
Deprecated alias for add_portfolio_experience()
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()
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()
split_relativities()
Deprecated low-level relativity constructor
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()