Skip to content

insurancerating 0.8.1

Choose a tag to compare

@MHaringa MHaringa released this 31 Jul 05:43

Overview of changes since 0.8.0

  • The excess-loss workflow has been made more portfolio-oriented and easier to
    audit. Threshold assessments now preserve input column names, support
    portfolio-level claim counts and can be presented with as_gt().
    redistribute_excess_loss() now combines capping and redistribution in one
    step and returns adjusted claim amounts for severity modelling.
  • Large-loss cost is redistributed over claim-bearing rows using portfolio,
    risk-factor or partial credibility redistribution. The total observed claim
    cost is preserved. Users can include the allocation in one severity response
    or retain it as a separate excess-loading component.
  • add_portfolio_experience() is now the primary helper for attaching observed
    portfolio experience to rating_table() objects. The former
    add_observed_experience() interface remains available as a deprecated
    compatibility wrapper.
  • The documentation for rating_table(), add_prediction() and the excess-loss
    workflow has been expanded with more applied portfolio examples. The pkgdown
    configuration and website build workflow have also been updated.

Main API updates

  • add_smoothing() now stops early with the affected column and missing-value
    count when model_variable contains NA. add_prediction() preserves NA
    predictions and reports their number in a warning.
  • add_restriction() and deprecated restrict_coef() can include tariff
    levels that were not observed when the GLM was fitted. Their supplied
    relativities are treated as explicit tariff assumptions. Set
    allow_new_levels = FALSE for strict matching against observed levels.
  • add_restriction() can add a fixed, expert-specified tariff factor that is
    present in the refinement data but absent from the fitted GLM. This requires
    the explicit opt-in allow_new_risk_factors = TRUE; the default remains
    FALSE. Deprecated restrict_coef() keeps its historical permissive
    behaviour and therefore uses TRUE by default.
  • Repeated add_restriction() calls for the same risk factor now update the
    existing restriction in place. Newly supplied relativities replace earlier
    values for those levels, while restrictions for other levels and the
    refinement-step order are retained.
  • Models returned by refit() now print a concise refinement summary followed
    by the regular GLM output. The stored call is shown as a readable glm(...)
    call instead of the internal function definition.
  • add_relativities() now uses coefficients from an earlier
    add_restriction() step automatically. The requested model variable and the
    effective restricted variable remain separately recorded, restrictions are
    not applied twice, and refinement-step ordering remains explicit. The final
    rating_table() reports only the derived split variable rather than also
    showing the intermediate restricted variable.
  • Refinement documentation now distinguishes the editable
    rating_refinement specification from the fitted GLM returned by refit().
    Functions that add or edit refinement steps reject ordinary and refitted
    GLMs with an actionable error. Iterative smoothing therefore retains the
    refinement specification and calls refit() after each adjustment.
  • The add_relativities() example now demonstrates that several original
    model levels can be refined in one relativities() specification by using
    multiple split_level() calls.
  • Deprecated rating_factors() again preserves the dynamic estimated-column
    name produced by rating_table(), and deprecated fit_gam() correctly
    forwards a user-supplied amount column.

Rating tables

  • add_portfolio_experience() is now the primary API for enriching a
    rating_table() object with observed portfolio experience.
  • add_observed_experience() is deprecated and remains available as a
    compatibility wrapper.
  • add_portfolio_experience() can calculate portfolio experience
    automatically from portfolio data for all risk factors in a rating_table(),
    and accepts multiple existing factor_analysis() objects.
  • autoplot.rating_table() accepts metric to choose the attached portfolio
    experience metric at plot time.

Excess-loss workflow

  • assess_excess_threshold() now returns class "threshold_assessment",
    preserves the original group and exposure column names, supports an optional
    claim-count column and uses as_gt() for report-ready threshold comparisons.
  • redistribute_excess_loss() replaces the former multi-step decomposition,
    allocation and loading workflow. It returns capped, excess, redistributed,
    adjusted and adjusted-average claim amounts using names derived from the
    supplied claim-amount column.
  • Redistribution is claim-count weighted. Rows without claims remain zero, and
    the adjusted loss reconciles to the original observed loss.
  • redistribute_excess_loss() now accepts redistribution_weight for
    risk-sensitive shares and receives_redistribution for selecting which
    claim-bearing rows receive redistributed excess loss.
  • redistribute_excess_loss() can now identify large losses that should remain
    unadjusted and should not contribute their excess to the redistribution pool.
  • The redistribution choice is now expressed through
    redistribution_method = "portfolio", "risk_factor" or "partial".
  • Results now inherit from "excess_redistribution". Their summary() method
    audits contributed and received excess loss, net loss shifts and changes in
    average claim amount by risk factor or another selected portfolio column.
  • redistribute_excess_loss() now exposes the risk-factor loading,
    credibility, portfolio loading, blended loading, preservation factor and
    final redistribution loading. Set calculation_details = FALSE to omit these
    row-level audit columns from modelling data; summary() retains the complete
    calculation audit.
  • redistribute_excess_loss() now supports output = "excess_loading" in
    addition to the backwards-compatible "redistributed_claim" default. The new
    mode keeps capped severity separate and returns allocated excess loss plus an
    excess loading per unit of redistribution_weight.