Exercise

# VaR from a fitted distribution

Minimizing CVaR requires calculating the VaR at a confidence level, say 95%. Previously you derived the VaR as a quantile from a Normal (or Gaussian) distribution, but minimizing the CVaR more generally requires computing the quantile from a distribution that best **fits** the data.

In this exercise a `fitted`

**loss distribution** is provided, which fits losses from an equal-weighted investment bank portfolio from 2005-2010. You'll first plot this distribution using its `.evaluate()`

method (fitted distributions will be covered in more detail in Chapter 4).

Next you'll use the `.resample()`

method of the `fitted`

object to draw a random `sample`

of 100,000 observations from the fitted distribution.

Finally, using `np.quantile()`

on the random `sample`

will then compute the 95% VaR.

Instructions

**100 XP**

- Plot the
`fitted`

loss distribution. Notice how the`fitted`

distribution is different from a Normal distribution. - Create a 100,000 point
`sample`

of random draws from the fitted distribution using`fitted`

's`.resample()`

method. - Use
`np.quantile()`

to find the 95% VaR from the random`sample`

, and display the result.