Introduction

At the start of a credit exposure, a borrower receives funding and promises future payments. A bank may approve a loan, a firm may issue a bond, a supplier may extend trade credit, or an investor may accept a stream of promised coupons. The transaction is recorded today, but its success depends on cash that must be generated later. The lender has a claim on future cash, and the borrower has to produce that cash when payment is due.

If scheduled payments are made, the credit contract works as intended. It allows households to buy homes, students to finance education, firms to invest, and governments to build before all resources are already available. If the borrower cannot make those payments, the same contract becomes a source of loss. A missed payment can become default. Default can lead to renegotiation, restructuring, bankruptcy, liquidation, or the closure of a business that no longer survives as an operating firm. The financial event can quickly become an economic event, affecting employees, suppliers, customers, creditors, investors, and communities.

This is why credit risk is never only a calculation about one borrower. A household default can damage family finances and restrict access to credit for years. A corporate default can freeze investment, destroy equity value, reduce supplier revenues, and cost jobs. A wave of defaults can weaken banks, force asset sales, raise funding costs, and transmit stress across markets. Credit risk starts with a promise to pay, yet its consequences can reach far beyond the original contract.

The analyst has to make the credit decision before repayment is observed. By the time we know whether the borrower pays, the loan has already been approved or rejected, the bond bought or avoided, the CDS quoted, the portfolio limit set, or the capital reserve assigned. Credit analysis therefore works in advance. It estimates how likely the payment is to fail, how large the loss could be, and whether the compensation or protection attached to the exposure is adequate.

Because the evidence changes, the modeling strategy changes as well. Historical loan data support direct scoring, while public firms require more inference from market prices and capital structure. Bond and CDS valuation move the analysis into promised cash flows, recovery, and compensation. Portfolio and climate applications then add common shocks, since borrowers may fail together and transition or physical hazards can affect cash flows, collateral, recovery, or refinancing. The technique changes with the evidence, while the purpose remains to estimate repayment failure before it occurs.

The purpose of this book is to make that calculation visible and checkable. A credit-risk model is useful when it connects a financial question with a decision. The decision may involve approving a borrower, judging whether a bond spread is attractive, pricing protection against default, estimating portfolio losses in bad states of the world, or measuring how much risk is missed when climate-related shocks are ignored. These questions require models, and the model has to remain explainable. The reader needs to see what information enters the model, how the calculation is performed, how the result is checked, and how the output changes the decision.

The book keeps the financial question, calculation, and interpretation in the same workflow. Equations express the financial relationship being used, R code performs the calculation, and tables or figures make the output visible. Interpretation stays close to the result so that a probability, price, spread, loss distribution, or capital measure remains tied to its financial use. A probability of default becomes meaningful through the lending rule it affects, just as a spread supports a pricing judgment, a loss distribution shapes a portfolio decision, and a climate adjustment changes the assessment of future repayment capacity.

The analysis begins where default is most directly observed, using borrower-level data to estimate default probabilities and translate them into credit decisions. It then moves toward settings where default is harder to observe directly and must be inferred from market information, capital structure, prices, dependence across borrowers, or scenario data. The tools become more sophisticated as the credit question becomes more demanding, yet the organizing logic remains the same. The reader starts with the payment at risk, identifies the information available today, computes the credit-risk quantity transparently, and interprets the result as part of a decision.

The intended reader is a finance, business, economics, or risk-management student or practitioner who wants to understand credit-risk models well enough to use them responsibly. The book assumes that the reader wants the mechanics as well as the conclusion. Mathematical notation is used when it clarifies the structure of the problem, and R code is used when the calculation has to be carried out. Many steps are shown explicitly because, in applied credit analysis, the intermediate steps are often where the meaning of the model becomes clear.

Credit-risk modeling is ultimately about estimating repayment failure before it happens. If the risk is misread, losses can appear as default, bankruptcy, forced selling, lost jobs, and market stress. Careful measurement gives the decision a clearer foundation. It helps explain why a borrower is accepted, why a spread looks attractive or thin, why protection has a fair price, why a portfolio needs capital, and why climate shocks can alter repayment capacity. Every credit exposure returns to the same three questions. What can go wrong, how large can the loss be, and is the risk worth taking?