scr_lgd_pools: LGD pools from the predicted LGD

View source: R/lgd.R

scr_lgd_poolsR Documentation

LGD pools from the predicted LGD

Description

Cuts the training predictions into n_pools quantile bands, merges the bands with fewer than min_defaults defaults into the neighbor with the closer long-run average, then merges adjacent bands whose long-run averages break the increasing order (pool-adjacent violators), so that the pools are ordered both in predicted and in realized LGD. Per pool: the default-weighted long-run average (the regulatory estimate), the exposure-weighted one, the standard error, the category-C margin of conservatism (one-sided 95% t interval on the mean) and their sum.

Usage

scr_lgd_pools(x, n_pools = NULL, min_defaults = NULL)

Arguments

x

An scr_lgd() object.

n_pools

Target number of pools; NULL uses lgd_n_pools.

min_defaults

Minimum defaults per pool; NULL uses lgd_min_defaults_bin.

Value

A data.table with one row per pool: pool, pred_lo, pred_hi, pred_mean, n, share, ead, lra, lra_ew, sd, se, moc_c, lra_moc, merged_from.

See Also

Other irb-lgd: scr_elbe(), scr_lgd(), scr_lgd_downturn(), scr_lgd_floor(), scr_lgd_validate(), scr_workout()

Examples

cfg <- scr_config(verbose = FALSE, nthread = 1, n_boot = 20)
wo <- scr_workout(scr_demo_lgd, scr_demo_lgd_cashflows, rates = scr_demo_rates, config = cfg)
m <- scr_lgd(wo, drivers = c("product", "ltv", "prior_dpd_max"), config = cfg)
scr_lgd_pools(m, n_pools = 4)

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