You observe n one-day losses of a trading book, drawn independently from a fixed heavy-tailed distribution. The distribution is not disclosed and varies between test cases. Losses are given with 6 digits after the decimal point.
For each level alpha in 0.99, 0.999, 0.9999, 0.99995, estimate the Value at Risk VaR (the alpha-quantile of the loss distribution) and the Expected Shortfall ES (the expected loss conditional on the loss being at least VaR).
The first line contains the integer n. Each of the next n lines contains one loss.
Four lines. Line i contains two real numbers: your estimates of VaR and ES at the i-th level.
Each of the eight estimates is scored max(0, 1 - r / R), where r is its relative error against the true distributional value and R is a fixed tolerance per estimate:
| level | R (VaR) | R (ES) |
|---|---|---|
| 0.99 | 0.075 | 0.2 |
| 0.999 | 0.3 | 0.5 |
| 0.9999 | 0.65 | 0.9 |
| 0.99995 | 0.75 | 1.1 |
The case score is the mean of the eight.
n = 20000