Package: insurancerating 0.8.2.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.2.9000.tar.gz
insurancerating_0.8.2.9000.zip(r-4.7-any)insurancerating_0.8.2.9000.zip(r-4.6-any)insurancerating_0.8.2.9000.zip(r-4.5-any)
insurancerating_0.8.2.9000.tgz(r-4.6-any)insurancerating_0.8.2.9000.tgz(r-4.5-any)
insurancerating_0.8.2.9000.tar.gz(r-4.7-any)insurancerating_0.8.2.9000.tar.gz(r-4.6-any)
insurancerating_0.8.2.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.75 score 95 stars 103 scripts 691 downloads 66 exports 113 dependencies

Last updated from:35ef20a65f. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK293
source / vignettesOK295
linux-releaseOK289
macos-releaseOK239
macos-oldrelOK156
windows-develOK254
windows-releaseOK241
windows-oldrelOK238
wasm-releaseOK126

Exports:active_rows_by_dateadd_observed_experienceadd_portfolio_experienceadd_predictionadd_rebasingadd_relativitiesadd_restrictionadd_shrinkageadd_smoothingadd_tariff_segmentsas_gtassess_excess_thresholdaudit_refinementautoplotbiggest_referencebootstrap_coefficientsbootstrap_performancebootstrap_rmsecalibrate_modelcheck_overdispersioncheck_residualsconstruct_model_pointsconstruct_tariff_classesderive_tariff_segmentsedit_smoothingextract_model_datafactor_analysisfisherfisher_classifyfit_gamfit_truncated_distfit_truncated_severityhistbinmerge_date_rangesmerge_date_ranges_dbmodel_datamodel_performanceoutlier_histogramperiod_to_monthsplot_severity_distributionpremium_changeprepare_refinementrating_factorsrating_factors2rating_gridrating_grid_dbrating_tableredistribute_excess_lossreducerefitrefit_glmrelativitiesrestrict_coefrgammatrisk_factor_gamriskfactor_gamrlnormtrmserows_per_dateset_reference_levelsmooth_coefsplit_levelsplit_periods_to_monthssplit_relativitiesunivariateupdate_glm

Dependencies:abindapearmaskpassbase64encbootbslibcachemciToolsclicodacodetoolscommonmarkcpp11crosstalkcurldata.tableDHARMadigestdoParalleldplyrevaluateevtreefarverfastmapfitdistrplusfontawesomeforeachFormulafsgapgap.datasetsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetshttpuvhttrinumisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallibcoinlifecyclelme4lmtestlubridatemagrittrMASSMatrixmemoisemgcvmimeminqamvtnormnlmenloptropensslotelpartykitpatchworkpillarpkgconfigplotlyplyrpromisespurrrqgamR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRdpackreformulasrlangrmarkdownrpartS7sandwichsassscalesscamshinysourcetoolsstringistringrstrucchangesurvivalsystibbletidyrtidyselecttimechangetinytexutf8vctrsviridisLitewithrxfunxtableyamlzoo

Refinement building blocks
Introduction | A compact unrestricted model | Preparing the refinement | Smoothing an ordered effect | Inspecting the proposal | Refining a selected part of the smoothing | Explicitly redirecting the curve | Applying a relative local adjustment | Adjusting the slope after an anchor | Interpreting the premium effect | Restricting selected levels | Shrinking a categorical effect | Adding differentiation within model levels | Combining and reviewing refinements | Refitting the model | Inspecting the fitted result | Calibrating the final level | Auditing the portfolio effect | When to revisit the model | Iterating without losing the specification | Summary | Where to go next

Last update: 2026-10-18
Started: 2026-04-16

Getting Started
Introduction | Portfolio and data | Understanding rating factors | Factor analysis | Basic factor analysis | Visualising factor behaviour | Handling continuous variables | Why continuous variables are treated separately | Analysing the shape with a GAM | Deriving tariff segments | Adding tariff segments to the data | Estimating frequency and severity | Why GLMs are used | Frequency model | Severity model | Constructing technical risk premium | From technical risk to tariff | Fitting a tariff representation | Interpreting model effects and observed experience | Rating table | Visualising coefficients | Validating the model | Overdispersion | Model performance | Bootstrap performance | Refining the tariff | Summary | Where to go next

Last update: 2026-08-10
Started: 2026-04-16

Large Portfolios
Why large portfolios require a different workflow | Memory rather than a fixed row limit | From policy records to model points | Optional temporal consolidation | Local model-point aggregation | Aggregation and GLM estimation | Lazy model-point aggregation with DuckDB | Scaling the same workflow to 10 and 50 million rows | Consolidating policy periods in DuckDB | Which reduction comes first? | Where to go next

Last update: 2026-08-10
Started: 2026-08-09

Model validation
What does model validation mean? | Validation map | Compact example setup | Comparing model performance | Inspecting tariff structure and observed experience | Assessing resampling stability | Checking distributional assumptions | Overdispersion | Simulation-based residuals | Reviewing observed versus expected experience | Validation, investigation and refinement | Putting the evidence together | Where to go next

Last update: 2026-08-10
Started: 2026-04-16

Pricing workflow and package building blocks
Package map | Understanding the portfolio | Preparing modelling data | Treating large losses | Understanding and structuring risk factors | Estimating technical risk | Interpreting model effects | Refining the tariff | Validating the model | Scaling to large portfolios | Choosing the building blocks | Where to go next

Last update: 2026-08-10
Started: 2026-05-11

Readme and manuals

Help Manual

Help pageTopics
Match event dates to active portfolio periodsactive_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
Rebase categorical tariff relativities to a reference leveladd_rebasing
Add sublevel relativities to a refinement workflowadd_relativities
Add coefficient restrictions to a refinement workflowadd_restriction
Shrink categorical tariff relativities towards a common leveladd_shrinkage
Smooth grouped tariff relativities in a refinement workflowadd_smoothing
Add derived tariff segments to portfolio dataadd_tariff_segments
Convert an object to a gt tableas_gt as_gt.bootstrap_coefficients as_gt.rating_table as_gt.threshold_assessment
Assess possible excess-loss thresholdsassess_excess_threshold
Audit the effect of a fitted model refinementaudit_refinement
Plot the resampled performance distributionautoplot.bootstrap_performance
Inspect simulation-based residual uniformityautoplot.check_residuals
Plot observed portfolio experience by risk factorautoplot.factor_analysis
Inspect a model refinement stepautoplot.rating_refinement
Compare fitted risk-factor effects graphicallyautoplot.rating_table
Inspect smooth risk-factor effects and tariff-segment boundariesautoplot.riskfactor_gam autoplot.tariff_effect autoplot.tariff_segments
Plot a fitted truncated severity distributionautoplot.truncated_dist autoplot.truncated_severity
Assess GLM coefficient stability by portfolio-row bootstrapbootstrap_coefficients
Assess performance stability under repeated resamplingbootstrap_performance
Calibrate the overall level of a refined pricing modelcalibrate_model
Check overdispersion of a Poisson claim frequency modelcheck_overdispersion
Check simulation-based model residualscheck_residuals
Derive candidate tariff segments from a smooth risk-factor effectderive_tariff_segments
Edit a smoothing curve in a refinement workflowedit_smoothing
Recover the portfolio data used by a fitted modelextract_model_data
Summarise observed portfolio experience by risk factorfactor_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
Merge connected portfolio periods in DuckDBmerge_date_ranges_db
Compare fitted GLMs using common performance measuresmodel_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
Interpret the premium effect of a smoothing curveas_gt.premium_change premium_change
Prepare a model refinement workflowprepare_refinement
Construct observed rating-grid pointsrating_grid
Reduce a database portfolio to observed rating-grid pointsrating_grid_db
Present fitted pricing-model effects as a rating tablerating_table
Redistribute large losses for severity or risk-premium modellingredistribute_excess_loss
Fit a prepared refinement specificationrefit
Define sublevel relativity specificationsrelativities relativity_specification split_level
Simulate severities from a truncated gamma distributionrgammat
Estimate a smooth effect for a continuous risk factorrisk_factor_gam
Simulate severities from a truncated lognormal distributionrlnormt
Calculate response-scale prediction errorrmse
Set the reference level of a factorset_reference_level
Split portfolio periods into calendar monthssplit_periods_to_months