The goal of the first part of the chapter is to show the methods of using R for pricing and performing Monte Carlo simulations with standard credit risk models. The following sections give an essential picture of loss distributions and the generating and pricing of a single debt instrument.

We start with the well-known option-based model of Merton (*Merton 1974*) as the introductory model of structural approach. Merton evaluates risky debt as a contingent claim of the firm value. Let us suppose that the `V`

firm value follows geometric Brownian motion:

In the preceding formula, `μ`

is the drift parameter, `σ>0`

is the volatility parameter, `dW`

is the differential of the Wiener process, and the initial asset value is `V`

. The model assumes a flat yield curve, with _{0}>0`r`

as the constant interest rate, and lets us define the default state as that where the value of the assets V falls below the liabilities (`K`

) upon the of maturity of debt (T). We express the V_{T...}