scr_default_rate: One-year default rates by cohort and the long-run average

View source: R/default.R

scr_default_rateR Documentation

One-year default rates by cohort and the long-run average

Description

From a flagged panel (an scr_default() object or any table with a 0/1 default column by unit and month), computes for every cohort start the population of non-defaulted units, the share that defaults within horizon months, optionally by grade or segment (as observed at the cohort start) and exposure-weighted when exposure is given. The long-run average is the arithmetic mean of the cohort rates. When the analyst proposes an adjusted value (lra_adjusted, for instance after judging that the period lacks bad years), it is benchmarked against the larger of the last five years' mean and the whole period's mean, and a flag records when it sits below that benchmark.

Usage

scr_default_rate(
  x,
  id = "id",
  date = "date",
  default = "default",
  horizon = 12L,
  by = NULL,
  grade = NULL,
  segment = NULL,
  exposure = NULL,
  lra_adjusted = NULL,
  config = scr_config()
)

Arguments

x

An scr_default or a data.frame/data.table.

id, date, default

Column names (ignored for an scr_default).

horizon

Months of the default window after the cohort start.

by

Cohort frequency: "month", "quarter" or "year".

grade, segment

Optional column names observed at the cohort start.

exposure

Optional column name; adds exposure-weighted rates.

lra_adjusted

Optional adjusted long-run average proposed by the analyst, in ⁠[0, 1]⁠; benchmarked and flagged, never applied.

config

A scr_config(); only pd_dr_by is read (the default of by).

Value

An object of class scr_dr: table (cohort rates, by grade or segment when given), portfolio (one row per cohort: n, defaults, dr), lra (mean, weighted_mean, recent5_mean, benchmark, adjusted, flag_below_benchmark, min, max, sd, n_cohorts, years), horizon and by.

See Also

Other irb-parameters: scr_default(), scr_irb_params()

Examples

d <- scr_default(scr_demo_panel, id = "id", date = "ref_date", dpd = "dpd",
                 config = scr_config(verbose = FALSE))
dr <- scr_default_rate(d, by = "quarter")
dr
dr$table

scorecraft documentation built on Dec. 6, 2026, 1:09 a.m.