Skip to contents

5,000 exposures in six segments that map one-to-one to the asset classes of the IRB risk-weight function. The PD is a grade PD (constant within asset class and grade; the ten geometric grades start below the regulatory floors on purpose) and the LGD a pool value constant within the segment, so that segment by grade is a homogeneous pool and the production SQL of scr_capital() reproduces R exactly. About 3 % of the exposures are in default with a best estimate of expected loss and a provision close to it; the other columns feed the standardized comparison and the accounting stage rule of scr_ecl().

Usage

scr_demo_portfolio

Format

A data.frame with 5,000 rows and 21 columns:

id

Exposure identifier.

segment

Reporting segment (retail_loans, mortgages, cards_revolver, cards_transactor, corporate_large, corporate_sme).

asset_class

Asset class of the risk-weight function.

grade

PD grade, G01 (safest) to G10.

pd

One-year PD of the grade (decimal).

lgd

Downturn LGD of the pool (decimal).

ead, drawn, undrawn

Exposure at default and its split.

m

Effective maturity in years (corporates only).

sales

Annual sales in millions (corporates only).

ltv

Loan-to-value at origination (mortgages only).

rating

External rating (large corporates; NA unrated).

transactor

Logical: revolving facility repaid in full monthly.

defaulted

0/1 default flag (about 3 %).

elbe

Best estimate of expected loss of the defaulted rows.

provision

Provision stock.

stage

Accounting stage 1, 2 or 3.

dpd

Days past due.

pd_orig

One-year PD at origination.

eir

Annual effective interest rate.

Source

Synthetic. Generated by data-raw/scr_demo_portfolio.R, seed 20260904, in the package source repository https://github.com/evandeilton/scorecraft.

Examples

head(scr_demo_portfolio)
#>       id        segment     asset_class grade       pd  lgd    ead  drawn
#> 1 E00001   retail_loans    retail_other   G05 0.006463 0.45   6415   6415
#> 2 E00002      mortgages retail_mortgage   G05 0.006463 0.15 264510 264510
#> 3 E00003 cards_revolver   qrre_revolver   G08 0.064633 0.75   2054   1724
#> 4 E00004      mortgages retail_mortgage   G04 0.003000 0.15 151164 151164
#> 5 E00005   retail_loans    retail_other   G05 0.006463 0.45   5875   5875
#> 6 E00006 cards_revolver   qrre_revolver   G04 0.003000 0.75   2470   1636
#>   undrawn  m sales  ltv rating transactor defaulted elbe provision stage dpd
#> 1       0 NA    NA   NA   <NA>      FALSE         0   NA       418     2  30
#> 2       0 NA    NA 0.31   <NA>      FALSE         0   NA      1603     1   0
#> 3     330 NA    NA   NA   <NA>      FALSE         0   NA         6     1   0
#> 4       0 NA    NA 0.33   <NA>      FALSE         0   NA      4362     2  60
#> 5       0 NA    NA   NA   <NA>      FALSE         0   NA        18     1   0
#> 6     834 NA    NA   NA   <NA>      FALSE         0   NA        20     1   0
#>    pd_orig   eir
#> 1 0.006463 0.250
#> 2 0.006463 0.113
#> 3 0.064633 0.360
#> 4 0.003000 0.100
#> 5 0.006463 0.231
#> 6 0.003000 0.390
table(scr_demo_portfolio$asset_class)
#> 
#>       corporate   corporate_sme   qrre_revolver qrre_transactor retail_mortgage 
#>             500             700             800             500            1000 
#>    retail_other 
#>            1500