RWA API¶
creditriskengine.rwa.irb.formulas
¶
IRB Risk Weight Formulas — BCBS d424 (December 2017).
This module implements the regulatory risk weight functions for all IRB asset classes. Each function documents its exact source paragraph from the Basel III framework.
CRITICAL: These formulas directly affect bank capital requirements. Every parameter, threshold, and formula must be verified against the referenced Basel Committee text.
asset_correlation_corporate(pd)
¶
Asset correlation for corporate, sovereign, and bank exposures.
Formula (BCBS CRE31.5): R = 0.12 * (1 - exp(-50 * PD)) / (1 - exp(-50)) + 0.24 * (1 - (1 - exp(-50 * PD)) / (1 - exp(-50)))
Produces R in [0.12, 0.24]: - R -> 0.24 as PD -> 0 - R -> 0.12 as PD -> 1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default (annualized, in [0.0003, 1.0]) |
required |
Returns:
| Type | Description |
|---|---|
float
|
Asset correlation R in [0.12, 0.24] |
Source code in creditriskengine\rwa\irb\formulas.py
sme_firm_size_adjustment(turnover_eur_millions)
¶
SME firm-size adjustment to correlation for corporate exposures.
Formula (BCBS CRE31.6): Adjustment = -0.04 * (1 - (min(max(S, 5), 50) - 5) / 45)
Where S = annual turnover in EUR millions. - S is floored at EUR 5M and capped at EUR 50M - Maximum reduction is 0.04 (at S = EUR 5M) - No adjustment when S >= EUR 50M
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
turnover_eur_millions
|
float
|
Annual sales/turnover in EUR millions |
required |
Returns:
| Type | Description |
|---|---|
float
|
Correlation adjustment (negative value to subtract from R) |
Source code in creditriskengine\rwa\irb\formulas.py
asset_correlation_residential_mortgage(pd)
¶
Asset correlation for residential mortgage exposures.
Formula (BCBS CRE31.8): R = 0.15
Fixed correlation of 0.15 per the 2017 Basel III reform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default (unused, kept for interface consistency) |
required |
Returns:
| Type | Description |
|---|---|
float
|
Fixed correlation of 0.15 |
Source code in creditriskengine\rwa\irb\formulas.py
asset_correlation_qrre(pd)
¶
Asset correlation for Qualifying Revolving Retail Exposures.
Formula (BCBS CRE31.9): R = 0.04
Fixed correlation for all QRRE exposures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default |
required |
Returns:
| Type | Description |
|---|---|
float
|
Fixed correlation of 0.04 |
Source code in creditriskengine\rwa\irb\formulas.py
asset_correlation_other_retail(pd)
¶
Asset correlation for Other Retail exposures.
Formula (BCBS CRE31.10): R = 0.03 * (1 - exp(-35 * PD)) / (1 - exp(-35)) + 0.16 * (1 - (1 - exp(-35 * PD)) / (1 - exp(-35)))
Range: [0.03, 0.16]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default |
required |
Returns:
| Type | Description |
|---|---|
float
|
Asset correlation in [0.03, 0.16] |
Source code in creditriskengine\rwa\irb\formulas.py
maturity_adjustment(pd, maturity)
¶
Maturity adjustment factor for corporate, sovereign, bank exposures.
Formula (BCBS CRE31.7): b = (0.11852 - 0.05478 * ln(PD))^2 MA = (1 + (M - 2.5) * b) / (1 - 1.5 * b)
Where M = effective maturity in years.
For F-IRB: M = 2.5 years fixed (BCBS CRE32.47). For A-IRB: M = max(1, effective maturity), capped at 5 years. Retail exposures: NO maturity adjustment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default (>= 0.0003) |
required |
maturity
|
float
|
Effective maturity M in years |
required |
Returns:
| Type | Description |
|---|---|
float
|
Maturity adjustment factor (multiplier to capital requirement K) |
Source code in creditriskengine\rwa\irb\formulas.py
irb_capital_requirement_k(pd, lgd, correlation)
¶
IRB capital requirement K (before maturity adjustment).
Formula (BCBS CRE31.4): K = LGD * [N((1-R)^(-0.5) * G(PD) + (R/(1-R))^0.5 * G(0.999)) - PD]
Where: - N() = standard normal CDF - G() = standard normal inverse CDF - R = asset correlation - PD = probability of default (floored at 0.03%) - LGD = loss given default
The 0.999 confidence level = 99.9th percentile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default (>= 0.0003 floor applied) |
required |
lgd
|
float
|
Loss Given Default (in [0, 1]) |
required |
correlation
|
float
|
Asset correlation R |
required |
Returns:
| Type | Description |
|---|---|
float
|
Capital requirement K as a fraction of EAD |
Source code in creditriskengine\rwa\irb\formulas.py
irb_risk_weight(pd, lgd, asset_class, maturity=2.5, turnover_eur_millions=None, is_qrre_transactor=False, ead=1.0)
¶
Full IRB risk weight computation.
Formula (BCBS CRE31.4-31.10): RW = K * 12.5 * MA (corporate/sovereign/bank) RW = K * 12.5 (retail)
The 12.5 multiplier converts K to risk weight because Capital = 8% * RWA = K * EAD, so RW = K * 12.5.
PD Floor (CRE32.13): 0.03% for all non-defaulted exposures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default |
required |
lgd
|
float
|
Loss Given Default |
required |
asset_class
|
str
|
One of 'corporate', 'sovereign', 'bank', 'residential_mortgage', 'qrre', 'other_retail' |
required |
maturity
|
float
|
Effective maturity in years (non-retail only) |
2.5
|
turnover_eur_millions
|
float | None
|
For SME firm-size correlation adjustment |
None
|
is_qrre_transactor
|
bool
|
If True, apply 0.75× RW scalar per CRE31.9 fn 15 |
False
|
ead
|
float
|
Exposure at Default (default 1.0) |
1.0
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as a percentage (e.g., 75.0 means 75%) |
Source code in creditriskengine\rwa\irb\formulas.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
double_default_rw(pd_obligor, pd_guarantor, lgd, maturity=2.5, asset_class='corporate')
¶
Double default risk weight using the substitution approach.
When a guarantee or credit derivative exists, the bank may substitute the guarantor's PD for the obligor's PD while retaining the asset correlation derived from the obligor's asset class.
Formula (BCBS CRE32.38-41): 1. Effective PD = max(PD_guarantor, PD_FLOOR) 2. Correlation R = derived from obligor's asset class using PD_obligor 3. K = IRB capital requirement using effective PD, obligor's R, and LGD 4. Apply maturity adjustment for non-retail asset classes 5. RW = K * 12.5
The guarantor PD is floored at 0.03% per CRE32.13.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd_obligor
|
float
|
Probability of Default of the original obligor. |
required |
pd_guarantor
|
float
|
Probability of Default of the guarantor. |
required |
lgd
|
float
|
Loss Given Default (in [0, 1]). |
required |
maturity
|
float
|
Effective maturity in years (non-retail only). |
2.5
|
asset_class
|
str
|
One of 'corporate', 'sovereign', 'bank', 'residential_mortgage', 'qrre', 'other_retail'. |
'corporate'
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as a percentage (e.g., 75.0 means 75%). |
Source code in creditriskengine\rwa\irb\formulas.py
equity_irb_rw(pd, equity_type='listed')
¶
IRB simple risk weight method for equity exposures.
Formula (BCBS CRE33): RW = max(floor, 2.5 * corporate_IRB_RW(PD, LGD=90%, M=5))
Where: - Listed equity: floor = 200% - Private/unlisted equity: floor = 300% - LGD is fixed at 90% per CRE33 - Maturity M is fixed at 5 years per CRE33 - The corporate IRB RW uses the standard corporate correlation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pd
|
float
|
Probability of Default. |
required |
equity_type
|
str
|
One of 'listed' or 'private'. |
'listed'
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as a percentage (e.g., 200.0 means 200%). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If equity_type is not 'listed' or 'private'. |
Source code in creditriskengine\rwa\irb\formulas.py
creditriskengine.rwa.standardized.credit_risk_sa
¶
Standardized Approach (SA) for Credit Risk — BCBS d424 CRE20.
Risk weight assignment logic for all SA exposure classes. Supports jurisdiction-specific overrides via YAML config.
get_sovereign_risk_weight(cqs, jurisdiction=Jurisdiction.BCBS, is_domestic_own_currency=False)
¶
Risk weight for sovereign exposures.
Reference: BCBS CRE20.7, Table 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cqs
|
CreditQualityStep
|
Credit quality step. |
required |
jurisdiction
|
Jurisdiction
|
Regulatory jurisdiction. |
BCBS
|
is_domestic_own_currency
|
bool
|
If True, domestic sovereign in own currency. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_bank_risk_weight(cqs=None, jurisdiction=Jurisdiction.BCBS, scra_grade=None, is_short_term=False)
¶
Risk weight for bank exposures.
Uses ECRA (External Credit Risk Assessment) if CQS provided, otherwise SCRA (Standardized Credit Risk Assessment).
Reference: BCBS CRE20.15-20.21.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cqs
|
CreditQualityStep | None
|
Credit quality step (for ECRA). |
None
|
jurisdiction
|
Jurisdiction
|
Regulatory jurisdiction. |
BCBS
|
scra_grade
|
str | None
|
SCRA grade A/B/C (when ECRA not used). |
None
|
is_short_term
|
bool
|
If True, use short-term claim risk weights. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_corporate_risk_weight(cqs, jurisdiction=Jurisdiction.BCBS, is_investment_grade=None, is_sme=False)
¶
Risk weight for corporate exposures.
Reference: BCBS CRE20.28-20.32, Table 7.
UK PRA divergence (PS9/24, para 3.17): Unrated investment-grade corporates = 65%.
EU CRR3 Art. 501 — SME supporting factor: Exposures <= EUR 2.5M: multiply RW by 0.7619 Exposures > EUR 2.5M: 0.7619 for first EUR 2.5M, 0.85 for remainder
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cqs
|
CreditQualityStep
|
Credit quality step. |
required |
jurisdiction
|
Jurisdiction
|
Regulatory jurisdiction. |
BCBS
|
is_investment_grade
|
bool | None
|
For UK PRA unrated corporate treatment. |
None
|
is_sme
|
bool
|
If True and jurisdiction supports it, apply SME factor. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_residential_re_risk_weight(ltv, jurisdiction=Jurisdiction.BCBS, is_cashflow_dependent=False, is_income_producing=False)
¶
Risk weight for residential real estate exposures.
Reference: BCBS CRE20.71-20.86, Tables 12-13. Whole-loan approach (BCBS/EU CRR3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ltv
|
float
|
Loan-to-value ratio (e.g., 0.75 for 75%). |
required |
jurisdiction
|
Jurisdiction
|
Regulatory jurisdiction. |
BCBS
|
is_cashflow_dependent
|
bool
|
If True, use cashflow-dependent table. |
False
|
is_income_producing
|
bool
|
If True, treated as income-producing. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
uk_pra_loan_splitting_rre(loan_amount, property_value, counterparty_rw=100.0, is_cashflow_dependent=False)
¶
UK PRA loan-splitting for residential real estate (PS9/24).
The UK PRA diverges from the EU/BCBS whole-loan approach by splitting each residential mortgage into two tranches:
- Secured tranche: The portion of the loan up to the LTV threshold (55% of property value). This tranche receives the lower LTV-based risk weight from the RRE table.
- Unsecured tranche: The remainder of the loan above the threshold. This tranche receives the counterparty risk weight (typically 100% for unrated corporates/retail).
The blended risk weight is the EAD-weighted average of both tranches.
Reference: PRA PS9/24, Chapter 4 (Real Estate).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loan_amount
|
float
|
Outstanding loan amount. |
required |
property_value
|
float
|
Current property value. |
required |
counterparty_rw
|
float
|
Risk weight for the unsecured tranche (default 100%). |
100.0
|
is_cashflow_dependent
|
bool
|
If True, use cashflow-dependent RRE table. |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, float]
|
Dict with: - 'secured_amount': Amount in the secured tranche. - 'unsecured_amount': Amount in the unsecured tranche. - 'secured_rw': Risk weight for the secured tranche (%). - 'unsecured_rw': Risk weight for the unsecured tranche (%). - 'blended_rw': EAD-weighted blended risk weight (%). - 'ltv': Loan-to-value ratio. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
get_commercial_re_risk_weight(ltv, counterparty_rw=100.0, is_cashflow_dependent=False, is_adc=False, is_presold_residential=False)
¶
Risk weight for commercial real estate exposures.
Reference: BCBS CRE20.87-20.98, Tables 14-15.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ltv
|
float
|
Loan-to-value ratio. |
required |
counterparty_rw
|
float
|
Risk weight of the counterparty. |
100.0
|
is_cashflow_dependent
|
bool
|
If True, use IPRE table (Table 15). |
False
|
is_adc
|
bool
|
If True, Land ADC treatment (150%). |
False
|
is_presold_residential
|
bool
|
If True and ADC, use 100%. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_defaulted_risk_weight(specific_provisions_pct, is_rre_secured=False)
¶
Risk weight for defaulted exposures.
Reference: BCBS CRE20.99-20.101.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
specific_provisions_pct
|
float
|
Specific provisions as % of outstanding. |
required |
is_rre_secured
|
bool
|
If secured by residential real estate. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_retail_risk_weight(is_regulatory_retail=True)
¶
Risk weight for retail exposures.
Reference: BCBS CRE20.65.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_regulatory_retail
|
bool
|
If True, meets regulatory retail criteria. |
True
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage (75% or 100%). |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_equity_risk_weight(is_listed=True, is_speculative=False)
¶
Risk weight for equity exposures.
Reference: BCBS CRE20.49-20.58.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_listed
|
bool
|
If True, listed equity. |
True
|
is_speculative
|
bool
|
If True, speculative unlisted equity. |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_subordinated_debt_risk_weight()
¶
Risk weight for subordinated debt.
Reference: BCBS CRE20.49.
Returns:
| Type | Description |
|---|---|
float
|
150% risk weight. |
get_covered_bond_risk_weight(cqs, is_qualifying=True, issuer_cqs=None)
¶
Risk weight for covered bond exposures.
Reference: BCBS CRE20.60-67, Table 10.
Qualifying covered bonds receive preferential risk weights based on the bond's own CQS. Non-qualifying covered bonds, or unrated qualifying covered bonds, fall back to the issuing bank's risk weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cqs
|
CreditQualityStep
|
Credit quality step of the covered bond. |
required |
is_qualifying
|
bool
|
If True, bond meets CRE20.61-66 qualifying criteria. |
True
|
issuer_cqs
|
CreditQualityStep | None
|
CQS of the issuing bank (used for unrated or non-qualifying bonds). |
None
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
get_mdb_risk_weight(mdb_category=1, cqs=CreditQualityStep.UNRATED)
¶
Risk weight for multilateral development bank exposures.
Reference: BCBS CRE20.8-9.
Qualifying MDBs (Category 1) receive 0% risk weight. Category 2 MDBs are treated using the bank ECRA table. Non-qualifying MDBs use the corporate risk weight table.
Categories: - Category 1 (qualifying): IBRD, IFC, ADB, AfDB, EBRD, IADB, EIB, etc. These receive 0% RW per CRE20.8. - Category 2: Other MDBs that meet some but not all qualifying criteria. Use bank ECRA table per CRE20.9. - Non-qualifying (category 3+): Use corporate risk weight table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdb_category
|
int
|
MDB category (1 = qualifying, 2 = bank table, 3+ = corporate table). |
1
|
cqs
|
CreditQualityStep
|
Credit quality step from external rating. |
UNRATED
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
assign_sa_risk_weight(exposure_class, cqs=CreditQualityStep.UNRATED, jurisdiction=Jurisdiction.BCBS, ltv=None, counterparty_rw=100.0, is_investment_grade=None, is_sme=False, is_cashflow_dependent=False, is_income_producing=False, is_adc=False, is_presold_residential=False, is_domestic_own_currency=False, specific_provisions_pct=0.0, is_rre_secured=False, is_listed=True, is_speculative=False, is_regulatory_retail=True, scra_grade=None, is_short_term=False, is_qualifying=True, issuer_cqs=None, mdb_category=1, config=None)
¶
Assign SA risk weight based on exposure class and parameters.
Master dispatcher that routes to the appropriate risk weight function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exposure_class
|
SAExposureClass
|
SA exposure class per BCBS CRE20. |
required |
cqs
|
CreditQualityStep
|
Credit quality step from external rating. |
UNRATED
|
jurisdiction
|
Jurisdiction
|
Regulatory jurisdiction. |
BCBS
|
ltv
|
float | None
|
Loan-to-value ratio for real estate. |
None
|
counterparty_rw
|
float
|
Counterparty risk weight for CRE. |
100.0
|
is_investment_grade
|
bool | None
|
For UK unrated corporate treatment. |
None
|
is_sme
|
bool
|
For EU SME supporting factor. |
False
|
is_cashflow_dependent
|
bool
|
For real estate cashflow dependency. |
False
|
is_income_producing
|
bool
|
For income-producing property. |
False
|
is_adc
|
bool
|
For land ADC exposures. |
False
|
is_presold_residential
|
bool
|
For pre-sold ADC. |
False
|
is_domestic_own_currency
|
bool
|
For domestic sovereign treatment. |
False
|
specific_provisions_pct
|
float
|
For defaulted exposures. |
0.0
|
is_rre_secured
|
bool
|
For defaulted RRE-secured exposures. |
False
|
is_listed
|
bool
|
For equity classification. |
True
|
is_speculative
|
bool
|
For speculative equity. |
False
|
is_regulatory_retail
|
bool
|
For retail qualification. |
True
|
scra_grade
|
str | None
|
SCRA grade for banks (A/B/C). |
None
|
is_short_term
|
bool
|
For short-term bank claims (CRE20.17). |
False
|
is_qualifying
|
bool
|
For covered bonds qualifying criteria (CRE20.61-66). |
True
|
issuer_cqs
|
CreditQualityStep | None
|
Issuing bank CQS for covered bonds. |
None
|
mdb_category
|
int
|
MDB category (1=qualifying, 2=bank, 3+=corporate). |
1
|
config
|
dict[str, Any] | None
|
Optional jurisdiction config dict. |
None
|
Returns:
| Type | Description |
|---|---|
float
|
Risk weight as percentage. |
Source code in creditriskengine\rwa\standardized\credit_risk_sa.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | |
creditriskengine.rwa.output_floor
¶
Output floor mechanism per BCBS d424, RBC25.2-25.4.
The output floor ensures that total RWA under internal models cannot fall below a specified percentage of total SA RWA.
Total_RWA_floored = max(Total_RWA_internal, floor_pct * Total_RWA_standardized)
Phase-in schedules differ by jurisdiction.
OutputFloorCalculator
¶
Calculate output-floored RWA.
The output floor ensures IRB RWA does not fall below a percentage of SA RWA.
Reference: BCBS d424, RBC25.2-25.4.
Example
calc = OutputFloorCalculator(Jurisdiction.EU, date(2026, 6, 30)) result = calc.calculate(irb_rwa=800.0, sa_rwa=1200.0) result["floored_rwa"] 800.0 # if 55% * 1200 = 660 < 800
Source code in creditriskengine\rwa\output_floor.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
calculate(irb_rwa, sa_rwa, pre_floor_irb_rwa=None)
¶
Apply the output floor.
Formula
floored_rwa = max(irb_rwa, floor_pct * sa_rwa)
For EU: applies transitional cap limiting RWA increase to 25%.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
irb_rwa
|
float
|
Total RWA from internal models. |
required |
sa_rwa
|
float
|
Total RWA from standardized approach. |
required |
pre_floor_irb_rwa
|
float | None
|
Pre-floor IRB RWA for EU transitional cap. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, float]
|
Dict with floored_rwa, floor_pct, floor_rwa, is_binding, add_on. |
Source code in creditriskengine\rwa\output_floor.py
get_output_floor_pct(jurisdiction, reporting_date)
¶
Get the applicable output floor percentage for a jurisdiction and date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jurisdiction
|
Jurisdiction
|
Regulatory jurisdiction. |
required |
reporting_date
|
date
|
Reporting/calculation date. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Floor percentage (e.g., 0.725 for 72.5%). |
float
|
Returns 0.0 if floor is not yet effective. |