Skip to main content
The percentile is a well-defined concept in the continuous case, but there are multiple ways to compute it from a discrete sample. Consider the following example. This is a plot of the 10 smallest values in a sample of 250 values drawn from the standard normal distribution. The plot shows the theoretical 2.5% quantile of the standard normal distribution (“theo”) as well as various types of 97.5 percentile estimation (floor, ceil, weighted, etc).
VaR Interpolation from discrete samples
Atoti Market Risk supports multiple types of VaR estimation, as described in this chapter.

Calculation steps

The algorithm can be described as follows:
  • Compute quantile as (1-confidence level)
  • Compute adjacent ranks based on the value of the level [Quantiles].[Quantiles].[QuantileName], quantile and discrete sample size
  • Sort PL and obtain PL values for the adjacent ranks and approximate VaR from the PL values using the interpolation formula controlled by the value of the level [Rounding].[RoundingMethods].[MethodName]

Computing adjacent ranks

The value of the level [Quantiles].[Quantiles].[QuantileName] is used to determine the rank calculation: Based on the computed rank xx, we can obtain various adjacent ranks:
  • xlowerx_{lower} = rounddown(x)round_{down}(x)
  • xhigherx_{higher} = roundup(x)round_{up}(x)
  • xnearestx_{nearest} = round(x)round(x)
  • xnearestEvenx_{nearestEven} = roundtoEven(x)round_{toEven}(x)
  • weightweight = fractionalPart(x)fractionalPart(x)
and the corresponding P&L values (in the sorted P&L vector):
  • PLlowerPL_{lower} as the value of the sorted P&L vector at rank xlowerx_{lower}
  • PLhigherPL_{higher} as the value of the sorted P&L vector at rank xhigherx_{higher}
  • PLnearestPL_{nearest} as the value of the sorted P&L vector at rank xnearestx_{nearest}
  • PLnearestEvenPL_{nearestEven} as the value of the sorted P&L vector at rank xnearestEvenx_{nearestEven}

VaR approximation

The value of the level [Rounding].[RoundingMethods].[MethodName] is be used to control the interpolation.