scr_ead: Estimate CCF pools from the reference data set

View source: R/ead.R

scr_eadR Documentation

Estimate CCF pools from the reference data set

Description

Splits the reference data set by reference date (the most recent cohorts form the hold-out), bins every driver against the realized CCF with the continuous binner (scr_bin_continuous()) on the training rows, revalidates the frozen bins on the hold-out and admits a driver when it passes the named rules TOO_FEW_DEFAULTS, NO_SEPARATION, NOT_MONOTONIC and UNSTABLE_HOLDOUT. The cells of the cross of the admitted drivers are ordered by their predicted CCF and merged, adjacent cells first, down to config$ccf_n_pools pools with at least config$ccf_min_defaults defaults each. Rows in the limit-factor measure form their own pool LF.

Usage

scr_ead(x, drivers, config = scr_config(), holdout = 0.3, params = NULL)

Arguments

x

An scr_ead_data() object.

drivers

Column names of the candidate drivers (columns of x$rds).

config

A scr_config().

holdout

Hold-out share, by whole reference dates.

params

An scr_irb_params() object; NULL uses the preset of config$framework.

Details

Per pool the estimate is the long-run (default-weighted) average of the realized values on the training rows, lra; moc_est is the one-sided normal estimation-error margin at config$ccf_moc_alpha; ccf_dt is the downturn value (equal to lra until scr_ead_downturn() is run); ccf_final = max(lra, ccf_dt) + moc_est; ccf_floor = params$ccf_floor_fraction * config$ccf_sa_ccf; and ccf_applied = max(ccf_final, ccf_floor). For the LF pool the floor depends on the utilization and is applied per row by scr_apply().

Value

An object of class scr_ead: pools (the pool table), cells (every cell of the cross with its pool), bins (the obwoe-shaped fit of the admitted drivers), bins_all (the fit of every driver), drivers (admission table), holdout (frozen bins on the hold-out), rds (the reference rows with sample and pool), metrics (per sample: rmse, mae, gauc with a bootstrap interval, spearman, ead_rmse, ead_mae, adequacy, cear), split, funnel, data_summary, downturn, ledger, model_card, params, config, meta. Also survivors (the admitted drivers) and lra (the long-run averages of the data set); metrics also carries n, n_main, gauc_se, somers_d and share_floor_binding.

See Also

Other irb-ead: scr_bin_continuous(), scr_ead_data(), scr_ead_downturn(), scr_ead_validate()

Examples

cfg <- scr_config(verbose = FALSE, n_boot = 20, nthread = 1)
ed <- scr_ead_data(scr_demo_ead, facility_id = "facility_id", date_col = "ref_date",
                   limit = "limit", drawn = "drawn", defaulted = "defaulted",
                   drivers = c("product", "months_on_book", "dpd"), config = cfg)
m <- scr_ead(ed, drivers = c("utilisation_ref", "product", "months_on_book"), config = cfg)
m
m$pools
m$drivers

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