A Practitioner’s Guide to Building, Validating and Defending a Credit Model That Decides
Julian R. Sterling
These are the companion files of Machine Learning for Finance by Julian R. Sterling.The book on Amazon →
The four Excel workbooks that go with the book, corrected where they were wrong. Every figure the book
prints is reproduced in them by a live formula rather than a typed constant, the score is rebuilt row by row
from the points table, and each workbook ends with a Checks sheet setting the printed figure
beside the computed one: 156 controls in all, every one green. Around them: the same four
models with the inputs emptied, thirteen working documents to print, forty questions that mark themselves,
and three cases the book names and never takes to a number. Nothing is locked, protected or watermarked.
Free to download. No sign-up, no email address, nothing to fill in.
Eleven workbooks, the question book, the printable documents and the read-me. Each group below can also be
downloaded on its own. Last revised 24 September 2026.
Get an email if these files are corrected
Optional. When a workbook on this page is corrected or a new worked case goes up, readers on the list get one email, plus a short note when a new book comes out. The downloads do not need it.
These carry the book’s own figures and its 8,400 applications, so that every number it prints can be
traced to a live formula, and each closes on its checks sheet.
Download these four1,196 KB
Chapters 1 to 6
The card, built from counts
Eight thousand four hundred applications as a filterable table, and the whole scorecard built
on top of them from nothing but counts. Bin tables for all seven characteristics, the weight
of evidence as the logarithm of the ratio of good share to bad share, the contribution of
every bin to the information value, and the information value as a column total.
The eighth characteristic is there too, the one that cannot be used: days past due at month
three, with an information value of 2.8606 against 0.2471
for the best usable field on the extract. Put it into the model and the area under the curve
goes from 0.7353 to 0.9125. It is measured three months after the money is
lent. The points table then derives its own factor and offset from twenty points to double
the odds and six hundred points at fifty to one — 28.8539 and
487.1229 — rather than taking them as given. Revised: the read-me placed the
boosted-tree score in column K of workbook 4’s Data sheet; it is column I. Three identity checks added.
The score is rebuilt row by row from the points table by lookup, not carried, and reconciled
against the reference model to seven decimals. On top of it: the ten development bands, the
area under the curve by ranks — 0.735329 — Gini at 0.470659, and
KS at 0.341154 with its exact location on the scale.
Then the distinction the book is built on. Out of time the ranking barely moves, to
0.718513. The level moves a great deal: the card under-predicts the bad rate
in nine bands out of ten, by 9.612 percentage points in the worst. The sheet
solves the single-parameter fix on the page — an intercept shift of 0.573620 in
log-odds, which is 16.55 points — and shows what it does and does not
repair. Revised: this page described that sheet before it existed; the Calibration sheet now solves the
shift by Newton’s method in live formulas. It takes the largest under-prediction from 9.612 points to 1.470,
leaves six bands under-predicted and widens the top band’s gap from 0.416 to 1.322.
The out-of-time distribution laid on the fixed development boundaries, which
is the only way to see a population move: recompute the deciles on the new population and you
erase exactly what you were trying to measure. Every population stability index term appears
as its own row — share difference times the logarithm of the share ratio — summing
to 0.090517, with the top band alone contributing 0.029335 as it falls from
10.00 per cent of the book to 5.33.
Then the sample nobody quotes. Through the door the applications run at 8.1190 per
cent bad; the accepted book runs at 5.2224 per cent and the declined at
12.7554 per cent. The sheet carries the split the four hand-written
policy rules produced, as the previous policy recorded it, and reconciles it to 682 bad cases, so you can watch a model's measured accuracy
change with nothing but the population it is measured on. Revised: the page said the split was rebuilt from
the rules; it cannot be, because three of the four cut inside a bin. Where a rule can be tested it holds,
with no accepted case under a 12-month judgment or below 1.00 of cover.
The unit economics derived on the sheet rather than asserted: 185,000 of exposure at 4.12 per
cent of margin less 640 of cost gives 6,982 for a loan that performs; 41.7
per cent of loss plus the same 640 gives minus 77,785 for one that does not; the swing is
84,767 and the break-even bad rate is 8.2367 per cent.
Both profit grids run live from 480 to 640 points. On the development book the peak is at
550 points, approving 83.50 per cent and earning
17,348,284; at 600, the score a nervous committee reaches for, the same book
earns 5,596,817. Switch the grid to 2020 and 2021 and the peak has moved thirty points, to
580: a policy left at 550 turns 2,563,882 into a loss of
149,416. The last sheet sets the card against a hundred and eighty boosted
trees at equal approval rates, in both years. Revised: the move from 550 to 600 leaves 4,002 loans
unwritten, 3,811 of them good, so each of the 191 defaults avoided costs 19.95 good loans against the
11.1408 one default is worth, not “nineteen and a half” against 12.1408.
The four workbooks with the 15 inputs of their shared Inputs sheet emptied. The checks sheets count what is still missing and test what holds for any inputs.
All chapters
Your scale, your prices, your coefficients
The card, discrimination and calibration, stability and the door, and the cut-off, with the same formulas and every assumption emptied: the points scale, the unit economics of one loan, and the seven fitted coefficients with the intercept. The 8,400 applications stay on the Data sheet, because they are the evidence the card is built from, not an assumption; a book of your own goes there in the same layout. The cut-off grid and the approval rates stay too, because they are the axes of their tables, not data.
The book’s 15 inputs are listed in a text file inside the archive. Type them back in and the book’s figures come back with them: an area under the curve of 0.735329, a stability index of 0.090517, 17,348,284 at a cut-off of 550.
Thirteen pages to print and use. A4, with margins wide enough for US Letter.
Chapters 1 to 15
Thirteen working documents
The model brief, with the definition of bad fixed before anything else. The characteristic review, availability first. The bin table, built from counts, with debt service cover beside blank rows. The points table and its scale. The leakage test, five questions for a field that looks too good. The discrimination report with its population stated. The calibration table on fixed bands. The recalibration memo. The stability report on the development boundaries. The through-the-door reconciliation. The unit economics and the break-even. The cut-off paper, both years on one page. The card against the trees, and the sign-off.
A workbook that marks itself. Answer in the yellow cells; the marking fills in as you go.
All parts of the book
Forty questions on the book
Seven on the card, seven on ranking and level, six on drift and the door, seven on the cut-off, six on trees, leaks and which area under the curve to quote, and seven on the three cases below. Numbers are marked to a tolerance, multiple choice to the letter, and the score sheet counts your errors part by part: that is your revision list.
Nothing is hidden. The marking sheet holds every answer, every tolerance, and the reason for each answer.
New material, not a restatement. Three situations the chapters name and never take to a number. Each case is one workbook: the note is the first sheet, the model is the rest, and a checks sheet closes it. Type your own figures in and every finding recomputes.
Chapters 11 to 15 · Case one
The grid on the accepted book
The book names the reject inference problem “in two numbers” and stops. Drawn on the accepted book, the only outcomes a real lender holds, the profit grid peaks at 560 in development, which earns 531,238 less at the door than 550; out of time it peaks at 570, not 580. Worse, the accepted book says the inherited 550 still earns 1,205,065 in 2020-2021, where at the door it loses 149,416. The slab from 550 to 559 decides it: 9.20 per cent bad among the accepted, 7.17 per cent at the door.
Chapters 13 to 15 · Case two
The price that moves the cut-off as far as the year did
Every cut-off is the best over a band of break-even rates, and the band comes from the grid alone. In development 550 is best for any margin from 3.59 to 5.21 per cent. To want 580, as 2020-2021 did, the margin would have to fall to 2.65 per cent, or the loss given default rise to 68.4; to keep 550 right out of time the margin would have to be 7.81 per cent. Re-pricing cannot rescue the old cut-off.
Chapters 1 to 12 · Case three
The leak, used as an alarm
Days past due at month three cannot decide a loan; it can watch a book. At 100 applications a month and 99 per cent confidence (ADDED), arrears at month three flag 2020-2021 in month 5.7; the outcome itself, which the definition of bad delays eighteen months, in month 19.8; the stability index never. Spread evenly (ADDED), the earlier alarm saves 1,595,523 of the 2,713,298 the old cut-off cost.
an input cell; everything else on the sheet is a formula
Black text
a formula — do not overtype these
Checks sheet
the printed figure beside the computed one, with a PASS or a FAIL; in the blank set and the cases, each control states its own verdict and the file ends ALL OK
ADDED
a figure the book does not give, used in the cases and marked wherever it appears
Why the checks matter more than the models
A workbook that agrees with a book proves nothing on its own — the author wrote both. What
the Checks sheets do is different: they force the model to reproduce, from a formula, a number
that was printed before the model existed.
Two quantities are carried as data rather than recomputed, and both are flagged as inputs on the
page itself. The eight fitted regression coefficients, because a logistic regression cannot be
fitted in a spreadsheet. And the boosted-tree score on every row, because an ensemble of a
hundred and eighty trees cannot be rebuilt in one either. Everything downstream of them —
their area under the curve, their bands, their profit at every approval rate — is computed
by the same live formulas as the card's, so the comparison is like for like.
Where two correct computations disagree, both are printed. The rank-sliced deciles put exactly
600 cases in every band; the fixed-boundary bands, which calibration and the stability index
require, put 600, 599, 601, 600, 600, 598, 602, 600, 600 and 600, because scores repeat and ties
have to fall on one side. Three non-bad cases move, one at the second boundary and two at the
sixth (revised: the page said two). Neither table is wrong and the gap is not smoothed away.
Go beyond the companion files
Machine Learning for Finance develops the complete framework behind these models, with the assumptions, trade-offs and worked examples tied together.
The workbooks open in Microsoft Excel, LibreOffice Calc, Google Sheets and Numbers; the PDF
prints on A4 or US Letter. They use no macros and no add-ins, so nothing needs to be enabled or trusted. If your spreadsheet asks
to update links on opening, decline — there are none.
What changed, and when
24 Sep 2026
The four workbooks corrected, 156 checks. The intercept shift of 0.573620, 16.55 points, is now solved on the Calibration sheet rather than only described; the fixed boundaries move three tied cases, not two; from 550 to 600 each default avoided costs 19.95 good loans against a break-even of 11.1408, not “nineteen and a half” against 12.1408; the accepted and declined split is the recorded decision, not rebuilt from the rules; the five areas under the curve span 0.2047, not 0.2141. Added: a blank set, thirteen working documents, forty questions that mark themselves, and three cases.
How do you run a Hosmer-Lemeshow test on a PD model?Sum (observed minus expected defaults) squared over N x PD x (1 minus PD) in ten groups: 10.98, p of 0.2028. It passes a model that under-predicts by 10.7%.
How do you calculate the Brier score for a PD model?Average of (predicted PD minus outcome) squared. An illustrative card scores 0.05588, then 0.10505 out of time, a rise mostly from the default rate doubling.
How do you calculate log loss for a PD model?Log loss = minus the average of y ln(PD) + (1 - y) ln(1 - PD). Ten PD bands on 10,000 loans give 0.2066, against 0.2338 for a model that predicts 6.25% for all.
Closing the DealTwo defensible bridges 20.70 million apart, a peg worth 7.00 million, and the six choices that remove 6.60 of a 12.00 earn-out.
CMBS and CRE CLOsWhere the loss actually lands, from appraisal reduction to realised severity, and what the B-piece is really being paid for.
How to Read a Commercial LeaseThe three refinements chapter 19 names and never performs, and the renewal rate below which the mark-to-market is worth nothing.
How to Read a Credit AgreementWhere the default actually comes from, the cure that costs 5.5 times the other, and the capacity nobody adds up.
How to Read a Real Estate Loan AgreementThe cure ratio in closed form, the four-point window in which the cheap cure works, and the cure sized to the wrong threshold.
Office Real EstateA six per cent yield that returns 3.2 per cent once the re-letting cycle is paid for, and the headline-to-net-effective rent arithmetic.
Private Equity Real EstateBoth worked waterfalls to the dollar, the two capital stacks, and the arithmetic of the promote made changeable.
Private Markets PerformanceThirty-one of the thirty-three figures chapter 19 publishes reproduce exactly — and the two that do not are named rather than quietly adopted.
Raising a Real Estate FundThe chapter 17 funnel run on a calendar — when the first close actually lands, and why more travel does not help.
Real Estate FinanceFour people look at one building and reach four numbers; the lender is whole only above 105,109,489, twelve per cent below today’s value rather than forty.
Real Estate Financial ModelingProperty, development and fund models built line by line, and the modelling test worked end to end.
Real Estate Fund ManagementThe waterfall of 6.11, the build-to-core of 8.7 and the proceeds gap, reproduced as live formulas rather than asserted.
REIT Analysis and ValuationFFO of 532.0, AFFO of 381.0, net asset value and dividend safety — every figure a formula you can change.
Retail Real EstateThe occupancy cost of every unit in a centre, the sixteen per cent of the rent roll no tenant can sustain, and the right-size-convert-or-hold decision priced.
Sale and LeasebackA €179.5 million transaction end to end, with rent cover measured on the entity that actually signs the lease.
Self-Storage Real EstateThe cohort engine behind a 590-unit store, and the rate increase on existing customers priced against the move-outs it causes.
The Fund Finance ProfessionalChapter 8 builds the reported-to-eligible NAV bridge; chapter 9 computes every ratio without it. Two points at every state — and what a subscription line does to the IRR.
The Growth Equity InvestorWhat a pro rata cheque really costs, and the band where defending your ownership loses money.
The Private Credit InvestorThe two coverage ratios are not measured on the same thing: the erosion is 47.7 per cent, not the 28.7 the headline implies.
The Private Equity Fund Controller PlaybookThe book defines IRR, DPI, RVPI and TVPI, tells you to update them at the exit, and prints not one value. Computed: a 1.833× deal inside a fund at 0.892 TVPI.
The Venture Capital AssociateWhat defending a position costs, and how many companies a reserve pool actually defends.
Financial Risk ManagementA fund inside every limit that cannot meet a redemption — and the number that decides it is the one with no currency attached.
Business ValuationThree advisers land 26.8 per cent apart on one company, and the whole gap turns out to be 1.96 points of perpetual growth.
Quantitative FinanceThree models agree to a quarter of one per cent about a number that one unobservable input moves a hundred and three times as much.
Asset ManagementFour people quote four returns for one mandate, all correct and 2.7017 points apart — forty-eight times the manager’s net skill.
Alternative InvestmentsA manager reports 13.29 per cent and the endowment earns 6.26 — both correct, and only a third of the advertised advantage arrives.
Credit AnalysisFour defensible EBITDAs on one borrower give leverage from 3.19x to 6.47x — and the add-back argument is fifty times the covenant headroom.
Venture CapitalOne company out of twenty-eight returns 56.7 per cent of the fund, and half the capital goes in after the decision — at half the return.
Commercial Real Estate InvestingThe equity earned 8.6647 per cent and the investor received exactly 8.0000 — the preferred return, and nothing above it.
Mergers and AcquisitionsThe board paper says the deal creates 13,436,667 of value. The arithmetic says it destroys 17,530,855. Nobody is lying.
DerivativesThe treasury report says the hedge cost 1,233,698. That is the interest differential, not a cost.
Treasury ManagementFive cash balances for one company, all correct and 145,600,000 apart — and the revolver that is two-thirds of the liquidity leaves at a revenue fall of 8.4127 per cent.
Financial Planning and AnalysisRevenue 3.0190 per cent above budget and operating profit 16.3209 per cent below it, in the same quarter, with every figure correctly stated.
Energy TradingA position report that is 91.7031 per cent hedged and correctly computed, on a book that is short 2,542,000 MWh — and a margin call of 198,400,000 the next morning.
Construction Cost ControlA contract sum of 26,301,102 became a final account of 29,153,363 on the building that was drawn — and 85.8 per cent of what was lost was knowable on the day it was signed.
Trade FinanceSix routes to payment on one 4,200,000 export order cost between 178,040 and 223,268, a spread worth 14.8 per cent of the margin, and a day of buyer credit costs 1,031.76.
Cost AccountingOne factory costed twice on the same 13,440,000 of overhead, and 4,053,091 moves between four product families.
Pricing StrategyA list price of 148.00, a pocket price of 112.51, and the nine deductions in between — with what one point of price is actually worth.
Contract ManagementA bid 5.50 a unit cheaper, signed on paper worth 9.81 a unit more — and 94.68 per cent of it was knowable on the day of signature.
Capital MarketsFour defensible readings of one bond, the cost of an issue under each convention, and the placement discount computed at a constant discount.
Financial RegulationThree ratios pass and the fourth is in breach by 1,956.0 million: the output floor, the liquidity buffer after encumbrance, and the loan split.
Bank ManagementFour defensible readings of one balance sheet, the deposit beta measured two ways, and the liquidity that lasts 3.9 days.
The Real Estate WorkoutFour ways out of one broken loan, discounted to today, and the 58.7 cents at which a payoff beats enforcement.
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.