Distributions: Exercises


9. Triangular Distribution and Bond Default Rate. The default rate for a bond portfolio is a random variable that follows a triangular distribution with a minimum of 0, maximum of 1, and mode of 0.04.

The mean (or expected value) of the triangular distribution is given by the formula:

$$E(X) = (min + mode + max) / 3$$

Use the above formula to compute the expected default rate for the bond portfolio.


# Define the parameters for the triangular distribution min_val <- ___ max_val <- ___ mode_val <- ___ # Compute the mean default rate mean_default_rate <- (___ + ___ + ___) / ___ # Print the mean default rate mean_default_rate # Define the parameters for the triangular distribution min_val <- 0 max_val <- 1 mode_val <- 0.04 # Compute the mean default rate mean_default_rate <- (min_val + max_val + mode_val) / 3 # Print the mean default rate mean_default_rate test_error() test_object("min_val", incorrect_msg="Check the minimum value for the triangular distribution.") test_object("max_val", incorrect_msg="Check the maximum value for the triangular distribution.") test_object("mode_val", incorrect_msg="Check the mode value for the triangular distribution.") test_object("mean_default_rate", incorrect_msg="Check your computation for the mean default rate.") success_msg("Excellent work!")
Remember to use the provided formula to compute the mean of the triangular distribution.

Previous Exercise Next Exercise