6. Individual Bond Default Simulation with Uniform Distribution. For a given bond, there's a default probability of 0.05. Instead of using the binomial distribution, you'll simulate the default outcome by drawing from a uniform distribution.
If the value you draw from a uniform distribution is below the default probability, we will assume that the bond defaults. Use the runif(n, min, max)
function in R
where n
is the number of draws, and min
and max
define the range of the uniform distribution.
Simulate a default outcome for the bond.