Analysis >Reports >Quantiles

The Predictive Power of Buckets and Quantiles over Projected Horizons

Quantiles are often misunderstood as they often seem to be too complicated for the beginner.

Truth is Quantiles are very easy to understand once you manage to remove the jargon and technical terms attached.

 

Quantiles Explained

Imagine you have a list of 100 students grades.

Say, you want to know what is the probability that students will get a at least a grade of 9 out of 10  ?

There are two ways you can answer this question.


You can proceed to capture all the information into percentiles.

  1. Take each student's grade and "Standardize it" to a percentage value.
  2. Sort every grade from best to worst.
  3. Begin from the best grade and proceed down until you reach a grade of 9 out of 10 or a score of 90%.
  4. Count the number of students that belong to the Best to 90% Tail.
  5. The number of students is your probability as there are 100 Student's.

    It's as simple as that!

This is actually what the standard quantile report does automatically.

In this example, you could actually take a shortcut by only catching values  the fall within a Tail:
You set the width (percentage) or size (number of returns) of the Lower and/or Upper Tail. the engine then retains returns that fall inside tails.


You can proceed to capture only the side of the distribution that provides the quickets answer.

In the previous example, we could have saved information found in the tail by storing grades above the normalized grade of 90% and discarding all other values:

  1. Take each student's grade and "Standardize" it to a percentage value.
  2. Go through each Student's grade.
  3. Keep only Student's with grades above or equal to 90%.
  4. The number of student's in your Tail is your probability as there are 100 Student's.

 

This is what we do with the Custom Quantiles/ Tails Report:

 

Calculating Quantiles

Assume that for each simulation horizon, there are N simulations. Quantiles are undefined for inputs less than 1/(N+1), or greater than N/(N+1).

The engine logs an exceptions if a quantiles outside the [1/(N+1), N/(N+1)] range is requested.

If all simulations are saved, quantiles are well-defined for 1/(N+1), 2/(N+1),…, N/(N+1).

The n/(N+1) quantile is the nth sorted return ( 1 ≤ n ≤ N).

Quantiles results between n/(N+1) and (n+1)/(N+1) are interpolated linearly.

In a Histogram Accumulator, returns are saved in bins, which compresses the number of returns saved.

For tailed returns that are saved, the n/(N+1) quantile is the nth sorted return ( nth return must be in a tail).

For all other values of n, we locate the bin containing the nth return.

 

 

 

Reading your Probabilities from Quantile Reports

Reading probabilities from the Table Report is Very simple.

Let's assume we are seeking the probabilities / chances that our Fx Forward position will not turn into a loss.

We therefore proceed by computing for every simulation horizon the quantile that includes a value above or equal to 0.

Horizon 1:

In the First Simulation Horizon, The quantile must be comuted through interpolation:

 

 

FXForward
Quantile Value:H[1] Value:H[2] Value:H[3] Value:H[4] Value:H[5] Value:H[6]
0.000001 -39.95 -70.85 -109.38 -140.34 -186.03 0.00
0.000100 -37.31 -55.44 -100.72 -117.62 -157.76 0.00
0.005100 -19.68 -33.02 -48.78 -59.47 -68.94 0.00
0.010000 -17.14 -29.31 -41.44 -50.79 -57.59 0.00
0.030000 -11.49 -21.44 -29.63 -34.90 -38.72 0.00
0.050000 -8.76 -16.93 -23.35 -27.79 -28.88 0.00
0.070000 -6.90 -14.00 -19.21 -22.60 -22.63 0.00
0.090000 -5.33 -11.70 -15.93 -18.80 -17.29 0.00
0.100000 -4.67 -10.60 -14.50 -17.04 -15.30 0.00
0.150000 -2.17 -6.40 -8.88 -9.90 -5.96 0.00
0.200000 -0.55 -3.22 -4.74 -4.44 -0.19 0.00
0.250000 0.10 -1.23 -1.29 -1.09 -0.08 0.00
0.300000 1.86 -0.72 -0.31 -0.92 0.02 0.00
0.350000 3.42 -0.21 -0.01 -0.74 0.13 0.00
0.400000 4.84 0.30 0.29 -0.56 0.24 0.00
0.450000 6.21 2.22 0.59 -0.39 0.35 0.00
0.500000 7.52 4.68 0.90 -0.21 0.46 0.00
0.550000 8.85 6.87 1.20 -0.03 0.57 0.00
0.600000 10.13 8.89 3.55 0.15 0.67 0.00
0.650000 11.40 10.96 6.86 0.32 0.78 0.00
0.700000 12.70 13.05 10.05 0.50 0.89 0.00
0.750000 14.03 15.11 13.33 5.42 1.00 0.00
0.800000 15.45 17.52 16.65 10.85 1.11 0.00
0.850000 17.13 20.14 20.27 16.49 1.22 0.00
0.900000 19.15 23.15 24.30 22.45 11.72 0.00
0.950000 22.09 27.38 30.14 30.19 24.53 0.00
0.990000 27.46 34.32 38.96 41.41 40.73 0.00
0.991000 27.79 34.63 39.35 41.96 41.72 0.00
0.992000 28.17 34.94 39.82 42.51 42.49 0.00
0.993000 28.54 35.45 40.36 43.27 43.19 0.00
0.994000 29.12 36.27 40.92 43.89 44.14 0.00
0.995000 29.72 37.13 41.51 44.82 45.31 0.00
0.996000 30.22 38.01 42.73 45.51 46.96 0.00
0.997000 30.77 38.99 44.31 46.77 48.94 0.00
0.998000 31.33 39.87 45.79 48.05 50.76 0.00
0.999000 32.67 41.85 47.97 52.22 53.59 0.00

Market Product Type Risk




Tail of Distribution (CVaR)

Lower Tail
Upper Tail