Quantifies the downturn component of the CCF from user-supplied downturn
periods. "type1" (observed impact) takes, per pool, the default-weighted
average of the realized values of the training events whose default date
falls in the periods (the hold-out stays independent) and sets
ccf_dt = max(lra, observed); "type3" (long-run average plus add-on)
sets ccf_dt = lra + add_on; "none" resets
ccf_dt = lra. The pool table is recomputed (ccf_final, ccf_applied)
and the ledger records the periods, the method and the reason.
Arguments
- x
An
scr_ead()object.- periods
A
data.framewithstartandenddates of the downturn periods (needed for"type1").- method
"type1","type3"or"none";NULLusesconfig$ccf_downturn.- add_on
Add-on of the
"type3"method, in CCF units.- reason
Text justifying the periods and the method; mandatory.
Value
The scr_ead object with downturn (a list with method,
periods, add_on and the per-pool table: pool, lra,
n_downturn, dt_observed, dt_type3, ccf_dt), the updated
pools and a new ledger row.
The table also carries ccf_final and ccf_applied; the object
n_rows_in_periods and reason.
See also
Other irb-ead:
scr_bin_continuous(),
scr_ead(),
scr_ead_data(),
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"), config = cfg)
m <- scr_ead(ed, drivers = c("utilisation_ref", "product"), config = cfg)
m2 <- scr_ead_downturn(m, periods = data.frame(start = as.Date("2024-01-01"),
end = as.Date("2024-12-01")),
reason = "2024 chosen as the stress year of the demo panel")
m2$downturn$table
#> pool lra n_downturn dt_observed dt_type3 ccf_dt ccf_final
#> <char> <num> <int> <num> <num> <num> <num>
#> 1: P1 0.3400611 26 0.3882968 0.4900611 0.3882968 0.4859478
#> 2: P2 0.5348808 41 0.5615728 0.6848808 0.5615728 0.6512281
#> 3: LF 0.8726786 7 0.8726786 1.0226786 0.8726786 0.9962084
#> ccf_applied
#> <num>
#> 1: 0.4859478
#> 2: 0.6512281
#> 3: 0.9962084
