Articles

How do you calculate the Brier score for a PD model?

The Brier score measures probability accuracy, level as well as ranking, but its size depends on the default rate, so it has to be decomposed before anyone concludes the model got worse.

The Brier score is the average squared difference between each loan's predicted PD and what happened, 1 for a default and 0 otherwise: BS = Σ(PD − outcome)² / N, and lower is better. On the development sample of the credit scorecard in Machine Learning for Finance it is 0.05588; out of time it nearly doubles to 0.10505. Decomposed, almost all of that rise is the population's default rate doubling, not the model getting worse: miscalibration adds only 0.00285.

Worked in full in Machine Learning for Finance by Julian R. Sterling, with every figure reproduced in a free workbook.See the book on Amazon →

Why a validator asks for it

Gini and KS measure ranking only: multiply every PD by two and they do not move. The Brier score is one of the few single numbers that punishes a wrong level as well as a wrong order, which is why it sits next to Gini in model validation reports, and why it is the usual loss for comparing a logistic card with a boosted tree on probability, not just on rank. Its weakness is that its size depends on the default rate of the sample, so a raw Brier score can only be compared with another one on the same population.

The data

The book's fictional lender scores small-business loans with a seven-characteristic card. The development sample has 6,000 loans and 379 bads, a 6.32 per cent bad rate; the out-of-time sample has 2,400 loans and 303 bads, 12.625 per cent. Both are cut into the same ten score bands, fixed on development, with the average predicted PD in each. The calculation below is done band by band, treating every loan in a band as carrying the band's average PD; with loan-level PDs the formula is identical, only longer.

The calculation, step by step

Per loan: (PD − y)², where y = 1 for a default and 0 otherwise

Per band: bads × (1 − PD)² + goods × PD²

Brier score = sum over bands / total loans

Band 1 of development: 133 × (1 − 0.2159)² + 467 × 0.2159² = 81.772 + 21.766 = 103.538

Excel, loan by loan with PDs in B2:B6001 and outcomes in C2:C6001: =SUMXMY2(B2:B6001,C2:C6001)/COUNT(C2:C6001)

Development sample: each band's contribution
BandLoansBadsPredictedObservedSquared error
1 (worst)60013321.59%22.17%103.538
25995710.78%9.52%51.672
3601397.72%6.49%36.561
4600365.91%6.00%33.840
5600354.72%5.83%33.033
6598243.85%4.01%23.038
7602203.13%3.32%19.338
8600132.47%2.17%12.724
9600161.85%2.67%15.613
10 (best)60061.15%1.00%5.941
Total6,0003796.32%6.32%335.3

335.3 / 6,000 = 0.05588. The worst band supplies almost a third of it on a tenth of the loans, and the bads supply most of it: a default predicted at 5.56 per cent costs 0.8919, a good loan at the same PD 0.0031.

Reading it: the decomposition

Murphy's decomposition splits the score into three parts, exactly when the PD is constant within each group, as here:

Brier = reliability − resolution + uncertainty

Reliability = Σ nk(PDk − observedk)² / N: calibration error, lower is better

Resolution = Σ nk(observedk − overall rate)² / N: how far the bands separate, higher is better

Uncertainty = overall rate × (1 − overall rate): set by the population, not the model

Brier skill score = 1 − Brier / uncertainty: improvement over predicting the average rate for everyone

Development, out of time, and out of time after recalibration
SampleBad rateBrierReliabilityResolutionUncertaintySkill score
Development6.32%0.055880.000060.003350.059185.57%
Out of time12.625%0.105050.002900.008160.110314.77%
Out of time, recalibrated12.625%0.102270.000120.008160.110317.29%

The rise of 0.04917 from development to out of time breaks down into +0.05113 from uncertainty, +0.00285 from reliability and −0.00481 from resolution, which actually improved because the bands spread further apart when defaults rose. The card did not lose its ability to separate; it lost its level, predicting 7.90 per cent on average against 12.625 observed. Shifting every log-odds by one constant, as in how to recalibrate a PD model to a new default rate, removes 0.00278 of reliability error and lifts the skill score from 4.77 to 7.29 per cent. Resolution does not move: recalibration repairs level, never ranking.

Skill scores of 5 to 7 per cent look poor beside a Gini of about 0.47 on the same card. They are not contradictory: with a bad rate in single figures most of the squared error is irreducible, and the Brier score is measuring that, not the ranking. Compare Brier scores between models on the same loans, never across portfolios.

The common mistakes

Takeaway

The ten bands, their predicted and observed rates and the recalibration shift solved on the calibration sheet are in the free workbooks for this case; the ranking side of the same card is in how to calculate Gini and KS for a credit scorecard.

Questions readers ask

What is a good Brier score for a credit model?

There is no universal threshold, because the score depends on the default rate. Predicting the average rate for everyone scores the rate times one minus the rate: 0.05918 at a 6.32 per cent bad rate. A useful model beats that; the illustrative card scores 0.05588, a skill score of 5.57 per cent. Judge models against each other on the same loans.

What is the difference between the Brier score and AUC?

AUC, and Gini, measure ranking only and ignore the level of the PDs; the Brier score penalises both. Doubling every PD leaves AUC unchanged but changes the Brier score. On the illustrative card the out-of-time bands still rank almost in order while reliability error rises from 0.00006 to 0.00290, which only the Brier decomposition shows.

How do you calculate the Brier skill score?

Brier skill score = 1 minus the model's Brier score divided by the score of a reference forecast, usually the sample default rate given to every loan, which equals rate times one minus rate. Out of time the illustrative card scores 0.10505 against 0.11031, a skill score of 4.77 per cent, rising to 7.29 per cent after recalibration.

Read the whole case

This article is one calculation from Machine Learning for Finance. The book takes the same case from first principles to the decision, chapter by chapter, and every figure it prints is a live formula in the free companion workbooks.

Get the book on Amazon →Free companion files

Also on Amazon UK · Amazon Germany · Amazon France · Amazon Canada

Also on this site

Reading guide: corporate finance, valuation and markets → · All 1340 articles →

If this book helped, or didn’t, a few lines on Amazon are worth more than they look: they are what the next reader goes on. Write a review. The workbook stays free either way.