Case Study 21 · Live, 28 November 2026

Retail Credit Risk: Scorecards, Expected Credit Loss and Capital

WoE scorecard · Monotonic gradient boosting · DeLong test · Reject inference · Markov chain · Survival and competing risks · Beta regression · IFRS 9 / CMN 4,966 · Basel IRB · PSI · SCR.data · Docker · R · Python · JavaScript · 33 tests

The business question

A bank, a fintech, a credit union or a retailer that sells on credit asks the same questions of its retail book. Whom to approve, and is a machine learning model worth what it costs to explain? What would the applicants we declined have done? How much should we provide for losses now that the provision follows expected loss (IFRS 9; in Brazil, CMN Resolution 4,966, whose expected loss chapter applies since 1 January 2025) and not arrears bands? How much capital does the book use, and what happens to both in a downturn? And how do we know, month after month, that the model still works?

This case answers each of them on public data, in R and Python, with the tests a model validator asks for. It shows the method; it is not the provision or the capital of any institution and makes no claim of regulatory compliance. The corporate side of credit risk is in the corporate credit early-warning case.

The data

All public, downloaded by a script with no account:

  • Personal loans: 1,347,681 Lending Club loans issued 2007-2018 with their final status, as prepared for granting models by Ariza-Garzón and co-authors (Zenodo, CC BY 4.0 as declared by them, from a public copy of the Lending Club data). It has no grade, interest rate or term, so nothing leaks from the lender’s own price.
  • Credit cards: 30,000 Taiwanese card accounts with six months of limit, bills, payments and arrears, April to September 2005, and default the following month (Yeh and Lien, UCI, CC BY 4.0).
  • Small-business loans: 687,375 SBA 7(a) term loans of up to US$ 1 million approved in fiscal years 2000-2019, with the date and amount of every charge-off (US Small Business Administration). Basel treats small loans to small firms as “other retail”.
  • Brazil: 90+ days delinquency by product, Selic, IPCA and unemployment from the Banco Central SGS series, and the Focus survey of 19 November 2026 for 2027.
  • The Brazilian credit system: SCR.data, every credit operation reported to the Banco Central above the reporting floor, aggregated by month from July 2012 to September 2026 (171 files, ODbL), by type of institution, product, income band and state.
  • United States: card charge-off rates (FRED) and the flow of card balances into 90+ days delinquency (New York Fed Household Debt and Credit Report).

No public data set without an account has Brazilian household loans with defaults and recoveries by contract. Each source does what its data allow, and the page says what each one lacks.

Try it

Move the cut-off and the cost of a bad loan; compare the scorecard and the challenger on an example applicant; see what each reject inference method gets wrong; set the threshold of a significant increase in credit risk and the weight of each scenario and watch the provision by stage; find the capital for any PD and LGD; shock the Selic rate and read the provision, the capital and the monthly monitoring; and see where Brazilian household credit stands, by product, institution, income and state.

Method, and why this one

Out of time, always. Lending Club loans issued 2007-2013 train the models (230,702 loans, 15.6% bad); 2014 recalibrates them and sets the cut-off (223,102 loans, 18.4% bad); 2015-2016 is the test (668,600 loans, 21.5% bad). Loans issued in 2017-2018 that were still running are missing from the source, so those years only feed the stability report.

A scorecard in R as the champion. Optimal binning, weight of evidence and information value (scorecard package), variables kept at an information value of 0.02 or more, logistic regression and points: 600 points at odds of 50 to 1 and 20 points to double the odds (Hand and Henley, 1997; Siddiqi, 2017; Thomas, Crook and Edelman, 2017). Python recomputes the weight of evidence on the same bins and matches R to 5 × 10⁻¹⁶.

Gradient boosting as the challenger, with the same rule. LightGBM forced to be monotone where the sign is not in doubt (PD falls with FICO and income, rises with debt and amount), recalibrated on 2014. Discrimination is compared with the DeLong test (DeLong, DeLong and Clarke-Pearson, 1988) and bootstrap intervals; calibration with the Hosmer-Lemeshow (Hosmer and Lemeshow, 1980), Spiegelhalter (1986), binomial and Jeffreys tests; value in money as in Blöchlinger and Leippold (2006): the cut-off that maximises profit on 2014, applied unchanged to the test. Reasons for a decline come from the points lost (scorecard) and from SHAP (Lundberg et al., 2020).

Reject inference with a known truth. Every Lending Club loan was approved, so the outcome of a declined applicant can be known, as in Crook and Banasik (2004): an old score trained on 2007-2012 declines the riskiest 30% of 2013 and 2014 applicants, with random overrides. The new model is built on the 2013 approvals with each method (ignoring rejects, augmentation, parcelling, fuzzy augmentation and a bivariate probit with sample selection, Van de Ven and Van Praag, 1981; Banasik and Crook, 2007) and judged on 2014, declined applicants included.

Behaviour and arrears. On the card book: a behaviour score built only from how the account was used, a monthly Markov chain between arrears buckets (current, one to two months, three months or more), and the share of the undrawn limit drawn before default (the credit conversion factor). Sex, age and marital status never enter a model; they serve only to check approval and error rates by group (Fuster et al., 2022).

Lifetime PD. On SBA loans: a discrete-time hazard, a logit for each quarter of loan age with the US consumer delinquency rate as the macro covariate (Bellotti and Crook, 2009), trained on fiscal years 2000-2009 and judged on 2010-2014; a Cox model (Cox, 1972) and the cumulative incidence of charge-off with early payoff as a competing risk (Fine and Gray, 1999), in R, as compared for credit by Dirick, Claeskens and Baesens (2017).

LGD and EAD. The SBA file gives the balance charged off, after collateral was sold, but not the balance at default, which comes years earlier, nor recoveries after the charge-off. LGD is therefore reported as bounds, and modelled by segment mean, beta regression (Ferrari and Cribari-Neto, 2004, with the squeeze of Smithson and Verkuilen, 2006) and a two-part model, out of time (Loterman et al., 2012), with the downturn years apart (Calabrese, 2014). Card LGD comes in aggregate: US card net charge-offs over the flow of balances into 90+ days.

Expected credit loss in three stages. Stage 1: losses from defaults in the next 12 months; stage 2: over the remaining life, discounted at the effective rate; stage 3, 90+ days past due: LGD × EAD, never below the floor of Annex I of BCB Resolution 352 for portfolio C5 (unsecured personal credit and revolving), 50% in the first month after default rising to 100% after 15 months. A significant increase in credit risk (articles 37 and 38 of CMN Resolution 4,966) compares today’s 12-month PD with the PD at the original allocation, which article 38 allows, with more than 30 days past due as the backstop.

Scenarios from Brazilian data. A satellite model explains the log-odds of 90+ delinquency by product with Selic (six months earlier) and IPCA (three months earlier), Newey-West errors, 2011-2026, in the spirit of the card stress tests of Bellotti and Crook (2013). A scenario moves Selic and IPCA from today’s values; the change in log-odds becomes a hazard ratio on every PD. Base: the Focus survey for 2027; adverse: Selic +3 p.p. and IPCA +2 p.p.; optimistic: Selic -2 p.p. and IPCA -1 p.p.

Capital. The Basel IRB formula for retail (CRE31.14 to 31.16; Gordy, 2003), with correlation 0.04 for qualifying revolving exposures and 0.03 to 0.16 for other retail, against the standardised 75%, with PDs at the point of the cycle and through the cycle.

The Brazilian system as the reference. Each SCR.data file is read in DuckDB with one SQL query that groups household operations into products (cards, non-payroll and payroll personal loans, vehicles, housing, overdraft, rural, other) and sums the Banco Central’s measures by product, type of institution, income band and state. Delinquency follows the Banco Central’s definition: the whole balance of operations with an instalment more than 90 days late, over the portfolio. Two breaks come from the methodology: up to May 2016 only operations above R$ 1,000 are reported, then above R$ 200; from 2025 problem assets are only those the institution classifies as such under CMN Resolution 4,966.

Monitoring and serving. A monthly report of the population stability index of the score and of each input, and of observed against predicted bad rate, with traffic lights; a scoring API that returns the PD, the points, the band and three reasons, in a slim Docker image that CI builds and calls on every push; and a model card in the spirit of the US agencies’ revised model risk guidance (SR 26-2, April 2026, which replaced SR 11-7).

Result

The challenger wins, and it is worth money. Out of time, the scorecard reaches an AUC of 0.634 and LightGBM 0.657 (DeLong z = 46); KS 0.193 against 0.223 (95% interval of the difference 0.026 to 0.035). Of the 0.023 gap, 0.007 comes from three inputs the scorecard drops for low information value: a scorecard with all eight reaches 0.641. With a good loan worth 1 and a bad loan costing 4, the cut-off chosen on 2014 gives the scorecard a profit of 69,326 on the test years and LightGBM 91,494, 32% more; approving everyone would lose 51,555. Benchmarks find logistic regression hard to beat by much (Baesens et al., 2003) and ensembles ahead in later studies (Lessmann et al., 2015); here the gap is small in AUC and large in money, because the money sits at the cut-off.

Neither model is calibrated two years later. Both average an 18.2% PD against a 21.5% bad rate in 2015-2016: Hosmer-Lemeshow, Spiegelhalter and the Jeffreys test reject in every band but the best one. The population did not change (stability index below 0.10 in 55 of 60 months); default risk did. The monthly report turns red on calibration from April 2016: recalibrate, do not rebuild.

Reasons for a decline differ. The scorecard blames FICO for 97% of the declines; LightGBM spreads the blame across FICO (43%), loan amount (32%) and income (17%). They agree on the first reason for 46% of the declined applicants.

Reject inference does not help here. In 2014, approved applicants went bad 16.9% of the time and declined ones 22.0%. Ignoring the rejects, the PD of the declined group is 19.5%; augmentation, fuzzy augmentation and the model that saw every outcome give the same within 0.15 p.p., with the same AUC (0.62). All sit below the truth because 2014 was worse than 2013. Parcelling adds 4.5 p.p. by construction. When the decision depends only on what the model sees, the approved sample is enough, which is what Crook and Banasik (2004) found. The bivariate probit with selection did not converge (the correlation went to its bound, 1): its exclusion restriction, renting, moves the decision too little.

On the card book, arrears explain most of the risk. The behaviour score reaches an AUC of 0.76 on a 30% hold-out. A current account falls one or two months behind with a 6.1% chance a month; an account one or two months late cures 25.3% of the time and reaches three months 6.3%. The chain gives a 12-month PD of 9.3% for a current account and 24.9% for one already late. Accounts that defaulted did not draw more of their limit beforehand: half drew nothing and the mean conversion factor of the undrawn limit is 0.24.

Fairness, checked outside the model. Declining the riskiest 20%, women are approved at 81.2% and men at 77.9% (impact ratio 1.04); age groups 21-29 and 60+ at 0.94 of the 30-44 group, all above the four-fifths reference. The score slightly over-predicts women’s default (21.5% against 20.3%) and under-predicts men’s (23.2% against 24.8%).

Vintage matters more than the cycle. On SBA loans, the cumulative charge-off after five years is 6.5% for loans approved in 2000-2004, 18.9% for 2005-2009, 3.7% for 2010-2014 and 4.4% for 2015-2019. Treating payoff as censoring overstates it: one minus Kaplan-Meier gives 40.6% after ten years for 2005-2009, against 27.1% with payoff as a competing risk. The hazard model ranks well out of time (AUC 0.83 for five-year charge-off) but predicts two to nearly three times the losses of the 2010-2014 vintages: the US delinquency rate does not capture how much worse the 2005-2009 loans were underwritten.

Loss given default resists modelling. On 106,791 charged-off loans, the loss is 71% of the original amount on average (median 77%), a lower bound; the upper bound, over the balance the schedule implies at charge-off, is 97%. Charge-offs of 2009-2011 lost 75% against 69% in other years; the lender’s share after the SBA guarantee is 22%. Out of time, no model beats the training mean (R² between -0.022 and -0.018), in line with Loterman et al. (2012). Card LGD in aggregate is 0.73 (10th to 90th percentile 0.59 to 0.87, 0.92 in 2009-2010).

Brazilian delinquency follows the Selic, not unemployment. One more point of Selic six months earlier raises the log-odds of 90+ delinquency by 0.076 on revolving card balances and 0.035 on non-payroll personal loans (p < 0.01). Unemployment comes out negative or nil for every product, in levels and in 12-month differences: the 90+ share is a stock, moved by write-offs and by lenders tightening when jobs are lost. It is left out of the scenarios, and the app has a management overlay for what the model cannot see.

Brazilian household credit is at the worst point of the series. In September 2026 households owe R$ 4.79 trillion in the SCR; 6.17% of it is in delinquency, a hair below the series high of August 2026 (6.19%) and more than twice the low of 2.85% in December 2020, and 9.53% is a problem asset. Cards (R$ 758 bn) run at 10.85%, up from 4.40% in April 2021; non-payroll personal loans at 11.81%; payroll loans at 3.94%; housing at 1.46%. Finance companies carry 15.1% delinquency and fintechs 23.1%, against 5.6% at banks and 5.5% at credit unions. Card delinquency is 14.4% for clients earning up to one minimum wage and 3.9% above twenty; five years earlier it was 8.0% and 1.2%: the gradient by income stayed, the level rose. By state it ranges from 10.9% in Tocantins to 4.6% in Santa Catarina. The SCR.data series for non-payroll personal loans tracks the SGS series of the satellite model (correlation 0.95 over 171 months), so the scenarios start from the right level: a peak.

The provision moves with PD before it moves with stages. On the card book (exposure NT$ 2.38 bn, with an undrawn limit converted at 0.24), the base provision is NT$ 217.0 m (9.1%): stage 1 holds 23,182 accounts and NT$ 99.4 m; stage 2 holds 6,355 accounts and NT$ 97.2 m; stage 3, 463 accounts and NT$ 20.3 m. Per unit of exposure, stage 2 costs 4.6 times stage 1. The Focus adverse scenario (hazard ratio 1.19) raises the provision 19.7% with no account changing stage. Only a severe shock (Selic +5 p.p. and a 0.5 overlay, hazard ratio 2.4) moves accounts: stage 2 triples to 18,649 and 36% of the rise comes from the moves. For this book the 30-day backstop decides stage 2; the relative criterion adds accounts only at 1.5 times the original PD or less. On the instalment book at origination (US$ 9.74 bn) the provision is 4.1% and no scenario reaches the doubling of PD that would move a loan: the cliff is there, out of sight.

IRB capital is higher than standardised on these books, and moves with the cycle. IRB risk weights are 130% on the card book and 113% on the instalment book, against 75% standardised: the PDs are high. With PDs at the point of the Brazilian cycle, card capital swings between 83% and 120% of its through-the-cycle level (Krüger, Rösch and Scheule, 2018, discuss the same pro-cyclicality). A Selic shock of 3 p.p. raises the card provision 22.6% and its capital 11.2%.

Limits

The card data are from Taiwan in 2005, the personal loans from a US platform, and the SBA borrowers are small businesses; the Brazilian data enter through the scenarios. The Lending Club file has no term and no rate, so the instalment book assumes 36 months and 13% a year, and the card book a 20% effective rate and a 36-month behavioural life. The card LGD is an aggregate, and the SBA LGD is a pair of bounds. In the Taiwan status columns “one month late” almost never appears before September, so one and two months are merged. The satellite model is a regression of a stock ratio on two macro variables; a bank would use its own default flows. The case does not cover pricing for risk, collections or fraud (see the fraud detection case).

Applied to your business

For a fintech, a credit union, a finance company or a retailer that sells on credit, the same steps run on your own book: a scorecard with reasons for every decline, a challenger judged on money, PD, LGD and EAD for the three stages, scenarios from Banco Central data, a stress table and a monthly monitoring routine your team can run. It starts with the Data & AI Diagnostic and runs in your environment.

Code

github.com/rhozon/retail-credit-risk

With Python 3.11 or later, R 4.4 and Node 18 or later:

pip install -e ".[dev,ml]"
python -I tools/fetch_data.py ~/data/credit-retail/raw --scr   # public data, no account
python -m crx.cli all --data ~/data/credit-retail
pytest -v                                                      # Python, and the page's JavaScript against it
Rscript -e 'testthat::test_dir("R/tests")'
docker build -t retail-credit-risk-api . && docker run --rm -p 8000:8000 retail-credit-risk-api   # POST /score

The suite has 33 tests (29 in Python, 4 in R). CI runs them on every push, builds the Docker image and calls the API inside it.

References

Data: Ariza-Garzón et al., Lending Club loan dataset for granting models (Zenodo, CC BY 4.0); Yeh, Default of Credit Card Clients (UCI Machine Learning Repository, CC BY 4.0); US Small Business Administration, 7(a) and 504 FOIA data; Banco Central do Brasil, SGS, Focus and SCR.data (ODbL); FRED, Federal Reserve Bank of St. Louis; New York Fed Consumer Credit Panel / Equifax. Regulation: Basel Committee on Banking Supervision, Basel Framework, CRE31; Resolução CMN nº 4.966, de 25/11/2021; Resolução BCB nº 352, de 23/11/2023; Board of Governors of the Federal Reserve System, OCC and FDIC, SR 26-2, Revised Guidance on Model Risk Management (17 April 2026).

  • Ariza-Garzón, M. J., Sanz-Guerrero, M., Arroyo Gallardo, J. and Lending Club (2024). Lending Club loan dataset for granting models. Universidad Complutense de Madrid. doi:10.5281/zenodo.11295916
  • Baesens, B., Van Gestel, T., Viaene, S., Stepanova, M., Suykens, J. and Vanthienen, J. (2003). Benchmarking state-of-the-art classification algorithms for credit scoring. Journal of the Operational Research Society, 54(6), 627-635. doi:10.1057/palgrave.jors.2601545
  • Banasik, J. and Crook, J. (2007). Reject inference, augmentation, and sample selection. European Journal of Operational Research, 183(3), 1582-1594. doi:10.1016/j.ejor.2006.06.072
  • Bellotti, T. and Crook, J. (2009). Credit scoring with macroeconomic variables using survival analysis. Journal of the Operational Research Society, 60(12), 1699-1707. doi:10.1057/jors.2008.130
  • Bellotti, T. and Crook, J. (2013). Forecasting and stress testing credit card default using dynamic models. International Journal of Forecasting, 29(4), 563-574. doi:10.1016/j.ijforecast.2013.04.003
  • Blöchlinger, A. and Leippold, M. (2006). Economic benefit of powerful credit scoring. Journal of Banking & Finance, 30(3), 851-873. doi:10.1016/j.jbankfin.2005.07.014
  • Calabrese, R. (2014). Downturn Loss Given Default: Mixture distribution estimation. European Journal of Operational Research, 237(1), 271-277. doi:10.1016/j.ejor.2014.01.043
  • Cox, D. R. (1972). Regression Models and Life-Tables. Journal of the Royal Statistical Society Series B: Statistical Methodology, 34(2), 187-202. doi:10.1111/j.2517-6161.1972.tb00899.x
  • Crook, J. and Banasik, J. (2004). Does reject inference really improve the performance of application scoring models? Journal of Banking & Finance, 28(4), 857-874. doi:10.1016/j.jbankfin.2003.10.010
  • DeLong, E. R., DeLong, D. M. and Clarke-Pearson, D. L. (1988). Comparing the Areas under Two or More Correlated Receiver Operating Characteristic Curves: A Nonparametric Approach. Biometrics, 44(3), 837. doi:10.2307/2531595
  • Dirick, L., Claeskens, G. and Baesens, B. (2017). Time to default in credit scoring using survival analysis: a benchmark study. Journal of the Operational Research Society, 68(6), 652-665. doi:10.1057/s41274-016-0128-9
  • Ferrari, S. and Cribari-Neto, F. (2004). Beta Regression for Modelling Rates and Proportions. Journal of Applied Statistics, 31(7), 799-815. doi:10.1080/0266476042000214501
  • Fine, J. P. and Gray, R. J. (1999). A Proportional Hazards Model for the Subdistribution of a Competing Risk. Journal of the American Statistical Association, 94(446), 496-509. doi:10.1080/01621459.1999.10474144
  • Fuster, A., Goldsmith-Pinkham, P., Ramadorai, T. and Walther, A. (2022). Predictably Unequal? The Effects of Machine Learning on Credit Markets. The Journal of Finance, 77(1), 5-47. doi:10.1111/jofi.13090
  • Gordy, M. B. (2003). A risk-factor model foundation for ratings-based bank capital rules. Journal of Financial Intermediation, 12(3), 199-232. doi:10.1016/S1042-9573(03)00040-8
  • Hand, D. J. and Henley, W. E. (1997). Statistical Classification Methods in Consumer Credit Scoring: A Review. Journal of the Royal Statistical Society Series A: Statistics in Society, 160(3), 523-541. doi:10.1111/j.1467-985X.1997.00078.x
  • Hosmer, D. W. and Lemeshow, S. (1980). Goodness of fit tests for the multiple logistic regression model. Communications in Statistics - Theory and Methods, 9(10), 1043-1069. doi:10.1080/03610928008827941
  • Krüger, S., Rösch, D. and Scheule, H. (2018). The impact of loan loss provisioning on bank capital requirements. Journal of Financial Stability, 36, 114-129. doi:10.1016/j.jfs.2018.02.009
  • Lessmann, S., Baesens, B., Seow, H. V. and Thomas, L. C. (2015). Benchmarking state-of-the-art classification algorithms for credit scoring: An update of research. European Journal of Operational Research, 247(1), 124-136. doi:10.1016/j.ejor.2015.05.030
  • Loterman, G., Brown, I., Martens, D., Mues, C. and Baesens, B. (2012). Benchmarking regression algorithms for loss given default modeling. International Journal of Forecasting, 28(1), 161-170. doi:10.1016/j.ijforecast.2011.01.006
  • Lundberg, S. M., Erion, G., Chen, H., DeGrave, A., Prutkin, J. M., Nair, B. et al. (2020). From local explanations to global understanding with explainable AI for trees. Nature Machine Intelligence, 2(1), 56-67. doi:10.1038/s42256-019-0138-9
  • Siddiqi, N. (2017). Intelligent Credit Scoring. Wiley. doi:10.1002/9781119282396
  • Smithson, M. and Verkuilen, J. (2006). A better lemon squeezer? Maximum-likelihood regression with beta-distributed dependent variables. Psychological Methods, 11(1), 54-71. doi:10.1037/1082-989X.11.1.54
  • Spiegelhalter, D. J. (1986). Probabilistic prediction in patient management and clinical trials. Statistics in Medicine, 5(5), 421-433. doi:10.1002/sim.4780050506
  • Thomas, L., Crook, J. and Edelman, D. (2017). Credit Scoring and Its Applications, Second Edition. SIAM. doi:10.1137/1.9781611974560
  • Van de Ven, W. P. M. M. and Van Praag, B. M. S. (1981). The demand for deductibles in private health insurance. Journal of Econometrics, 17(2), 229-252. doi:10.1016/0304-4076(81)90028-2
  • Yeh, I. C. (2009). Default of Credit Card Clients. UCI Machine Learning Repository. doi:10.24432/C55S3H
  • Yeh, I. C. and Lien, C. H. (2009). The comparisons of data mining techniques for the predictive accuracy of probability of default of credit card clients. Expert Systems with Applications, 36(2), 2473-2480. doi:10.1016/j.eswa.2007.12.020
WhatsApp ↑