scr_lgd_validate: Validation battery of an LGD model

View source: R/lgd.R

scr_lgd_validateR Documentation

Validation battery of an LGD model

Description

Runs the three blocks of the usual LGD validation on the hold-out sample (or on newdata) against the training reference:

Usage

scr_lgd_validate(x, newdata = NULL)

Arguments

x

An scr_lgd() object.

newdata

NULL (the hold-out), an scr_workout() object or a table with the drivers, lgd_real, ead and the default date.

Details

  • Calibration. Per pool and for the portfolio, the one-sided t-test of realized against estimated LGD (the pool long-run average), where under-estimation is the failure: p = 1 - Phi(t); the loss shortfall ⁠1 - sum(LGD_real E) / sum(LGD_pred E)⁠; the coverage of the realized mean by the downturn LGD; the regression of realized on predicted.

  • Discrimination. Somers' D / generalized AUC of the prediction with its bootstrap interval, compared with the training value through S = (gAUC_init - gAUC_curr) / sigma_curr; Spearman rho; the loss capture ratio; R-squared.

  • Stability. PSI of the pool distribution and of the bins of every driver of both stages, with the fixed and the n-adjusted threshold.

  • Pools. Homogeneity within a pool (Welch test between the halves of the pool split at its median prediction; a small p-value means a pool that still discriminates) and heterogeneity between adjacent pools (Welch test; a large p-value means pools that do not differ).

Traffic lights use the p-value thresholds of config$pd_lights (shared with the PD validation) (red at or below the first, amber at or below the second) and the fixed PSI thresholds.

Value

An object of class scr_lgd_validation: calibration (per pool), portfolio, discrimination, stability (pools, drivers), homogeneity, heterogeneity, summary (test, statistic, p, light; the light is "grey" when the test has no result, and a row that sums up several pools or drivers is the worst of their lights: red, then amber, then green, otherwise grey), sample, n.

See Also

Other irb-lgd: scr_elbe(), scr_lgd(), scr_lgd_downturn(), scr_lgd_floor(), scr_lgd_pools(), 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)
v <- scr_lgd_validate(m)
v
v$calibration

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