Package: insurancerating 0.8.0.9000

insurancerating: Actuarial Tools for Insurance Pricing Models

Provides actuarial tools and building blocks for analysing, modelling, refining, and validating insurance rating models. Designed to support common GLM-based pricing tasks and the translation of statistical model output into practical tariff structures. The package supports the construction of insurance tariff classes using a data-driven approach, based on the methodology of Antonio and Valdez (2012) <doi:10.1007/s10182-011-0152-7>.

Authors:Martin Haringa [aut, cre]

insurancerating_0.8.0.9000.tar.gz
insurancerating_0.8.0.9000.zip(r-4.7)insurancerating_0.8.0.9000.zip(r-4.6)insurancerating_0.8.0.9000.zip(r-4.5)
insurancerating_0.8.0.9000.tgz(r-4.6-any)insurancerating_0.8.0.9000.tgz(r-4.5-any)
insurancerating_0.8.0.9000.tar.gz(r-4.7-any)insurancerating_0.8.0.9000.tar.gz(r-4.6-any)
insurancerating_0.8.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
insurancerating/json (API)

# Install 'insurancerating' in R:
install.packages('insurancerating', repos = c('https://mharinga.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/mharinga/insurancerating/issues

Pkgdown/docs site:https://mharinga.github.io

Datasets:
  • MTPL - Motor Third Party Liability (MTPL) portfolio
  • MTPL2 - Motor Third Party Liability

On CRAN:

Conda:

actuarialactuarial-scienceinsurancepricing

8.34 score 90 stars 86 scripts 726 downloads 59 exports 111 dependencies

Last updated from:699a7256f6. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK253
source / vignettesOK311
linux-release-x86_64OK256
macos-release-arm64OK205
macos-oldrel-arm64OK232
windows-develOK205
windows-releaseOK200
windows-oldrelOK197
wasm-releaseOK178

Exports:active_rows_by_dateadd_observed_experienceadd_portfolio_experienceadd_predictionadd_relativitiesadd_restrictionadd_smoothingadd_tariff_segmentsallocate_excess_lossapply_excess_loadingassess_excess_thresholdautoplotbiggest_referencebootstrap_performancebootstrap_rmsecalculate_excess_losscheck_overdispersioncheck_residualsconstruct_model_pointsconstruct_tariff_classesderive_tariff_segmentsedit_smoothingextract_model_datafactor_analysisfisherfisher_classifyfit_gamfit_truncated_distfit_truncated_severityhistbinmerge_date_rangesmodel_datamodel_performanceoutlier_histogramperiod_to_monthsplot_severity_distributionprepare_refinementrating_factorsrating_factors2rating_gridrating_tablereducerefitrefit_glmrelativitiesrestrict_coefrgammatrisk_factor_gamriskfactor_gamrlnormtrmserows_per_dateset_reference_levelsmooth_coefsplit_levelsplit_periods_to_monthssplit_relativitiesunivariateupdate_glm

Dependencies:abindapearmaskpassbase64encbootbslibcachemciToolsclicodacodetoolscommonmarkcpp11crosstalkcurldata.tableDHARMadigestdoParalleldplyrevaluateevtreefarverfastmapfitdistrplusfontawesomeforeachFormulafsgapgap.datasetsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetshttpuvhttrinumisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallibcoinlifecyclelme4lmtestlubridatemagrittrMASSMatrixmemoisemgcvmimeminqamvtnormnlmenloptropensslotelpartykitpatchworkpillarpkgconfigplotlyplyrpromisespurrrqgamR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRdpackreformulasrlangrmarkdownrpartS7sassscalesscamshinysourcetoolsstringistringrsurvivalsystibbletidyrtidyselecttimechangetinytexutf8vctrsviridisLitewithrxfunxtableyamlzoo

Pricing workflow building blocks
1. Start with portfolio experience | 2. Assess large losses | 3. Translate continuous factors into tariff segments | 4. Fit and interpret a GLM | 5. Refine tariff effects when needed | 6. Validate model behaviour | Typical workflow | Next steps

Last update: 2026-06-03
Started: 2026-05-11

Getting started
Introduction | Data | Step 1 — Portfolio analysis | Factor analysis | Basic factor analysis | Visualising factor behaviour | Step 2 — Continuous variables | Why continuous variables are treated separately | Analysing the shape with a GAM | Deriving tariff segments | Adding tariff segments to the data | Step 3 — Model estimation | Why GLMs are used | Frequency model | Severity model | Constructing a premium proxy | Step 4 — Premium model | Fitting a premium model | Step 5 — Interpreting coefficients | Rating table | Visualising coefficients | Step 6 — Model evaluation | Model performance | Bootstrap performance | Step 7 — From model to tariff | Summary | Next steps

Last update: 2026-06-02
Started: 2026-04-16

Model validation
Introduction | Example setup | Step 1 — Comparative model performance | Step 2 — Coefficient inspection | Step 3 — Predictive stability | Step 4 — Dispersion checks | Step 5 — Residual diagnostics | Step 6 — Portfolio-level structure | Validation in context | Summary | Next steps

Last update: 2026-05-11
Started: 2026-04-16

Refinement building blocks
Introduction | When refinement can help | Example setup | The refinement object | Smoothing | Purpose | Adding smoothing | Inspecting smoothing before refit | Choosing a smoothing method | Restrictions | Adding restrictions | Inspecting restrictions before refit | Expert-based relativities | Adding relativities | Refit | Why refit is required | Inspecting the final fitted result | Visualising the final structure | Model data and rating grids | Complete example | Legacy interface | Summary | Next steps

Last update: 2026-05-11
Started: 2026-04-16

Readme and manuals

Help Manual

Help pageTopics
Find active portfolio rows for event datesactive_rows_by_date
Add portfolio experience to a rating tableadd_portfolio_experience add_portfolio_experience.rating_table
Add model predictions to a pricing data setadd_prediction
Add expert-based relativities to a refinement workflowadd_relativities
Add coefficient restrictions to a refinement workflowadd_restriction
Add smoothing to a refinement workflowadd_smoothing
Add derived tariff segments to portfolio dataadd_tariff_segments
Allocate excess loss to a pricing portfolioallocate_excess_loss
Apply excess loading to a pricing portfolioapply_excess_loading
Assess possible excess-loss thresholdsassess_excess_threshold
Autoplot for bootstrap_performance objectsautoplot.bootstrap_performance
Autoplot for check_residuals objectsautoplot.check_residuals
Plot an excess-loss allocationautoplot.excess_loss_allocation
Plot an excess threshold assessmentautoplot.excess_threshold_assessment
Automatically create a ggplot for objects obtained from factor analysisautoplot.factor_analysis
Plot a model refinement stepautoplot.rating_refinement
Plot risk factor effects from 'rating_table()' resultsautoplot.rating_table
Autoplot for GAM objects from 'risk_factor_gam()'autoplot.riskfactor_gam
Autoplot for tariff segment objectsautoplot.tariff_segments
Plot a fitted truncated severity distributionautoplot.truncated_dist autoplot.truncated_severity
Bootstrapped model performancebootstrap_performance
Decompose claim amounts into capped and excess partscalculate_excess_loss
Check overdispersion of a Poisson claim frequency modelcheck_overdispersion
Check simulation-based model residualscheck_residuals
Derive insurance tariff segmentsderive_tariff_segments
Edit an existing smoothing step in a refinement workflowedit_smoothing
Extract model dataextract_model_data
Factor analysis for discrete risk factorsfactor_analysis
Fisher's natural breaks classificationfisher_classify
Fit severity distributions to truncated claim datafit_truncated_severity
Reduce portfolio periods by merging adjacent date rangesmerge_date_ranges
Performance of fitted GLMsmodel_performance
Motor Third Party Liability (MTPL) portfolioMTPL
Motor Third Party Liability (MTPL) portfolio (3,000 policyholders)MTPL2
Portfolio histogram with tail binsoutlier_histogram
Exploratory severity diagnostics by categoryplot_severity_distribution
Prepare a model refinement workflowprepare_refinement
Construct observed rating-grid points from model data or a data framerating_grid
Build rating tables from fitted pricing modelsrating_table
Refit a prepared refinement workflowrefit
Combine multiple level splits into relativitiesrelativities
Generate random samples from a truncated gamma distributionrgammat
Fit a GAM for a continuous risk factorrisk_factor_gam
Generate random samples from a truncated lognormal distributionrlnormt
Root Mean Squared Error (RMSE)rmse
Set the reference level of a factorset_reference_level
Define a level split with relativitiessplit_level
Split policy periods into monthly rowssplit_periods_to_months
Construct a relativities mapping for level splittingsplit_relativities