Exercise

Extreme values and backtesting

Extreme values are those which exceed a threshold and are used to determine if risk measures such as VaR are accurately reflecting the risk of loss.

You'll explore extreme values by computing the 95% VaR of the equally-weighted investment bank portfolio for 2009-2010 (recall that this is equivalent to historical simulation from 2010 onwards), and then backtesting on data from 2007-2008.

2009-2010 portfolio losses are available in estimate_data, from which you'll compute the 95% VaR estimate. Then find extreme values exceeding the VaR estimate, from the 2007-2008 portfolio losses in the available backtest_data.

Compare the relative frequency of extreme values to the 95% VaR, and finally visualize the extreme values with a stem plot.

Instructions

100 XP
  • Compute the 95% VaR on estimate_data using np.quantile().
  • Find the extreme_values from backtest_data using VaR_95 as the loss threshold.
  • Compare the relative frequency of extreme_values to the VaR_95 estimate. Are they the same?
  • Display a stem plot of extreme_values, showing how large deviations clustered during the crisis.