7. Simulating Total Bond Payments. You have a portfolio of 100 bonds. Each bond defaults with a probability of 0.07. If a bond defaults, it pays $0 at the end of one year. Otherwise, it repays $1.10. In this exercise, you'll simulate the total repayments of the bond portfolio using the Binomial distribution.
Use the rbinom(n_sims, n_bonds, prob)
function in R
to simulate the number of defaults, where n_sims
is the number of simulations, n_bonds
is the number of bonds, and p
is the default probability for a single bond.
Compute the total repayments for the bond portfolio after one year.