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).ÂDocumentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.

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:
| Member value | Description | Formula for rank | Example | Notes |
|---|---|---|---|---|
| Centered | Corresponds to the “First variant, C=1/2” of the interpolation variants described on this wiki | (1-97.5%) x 250 + 0.5 = 6.75 | ||
| Equal Weight | Corresponds to the “Third variant, C=0” of the interpolation variants described on this wiki | (1-97.5%)x (250+1) = 6.275 | default option | |
| Exclusive | (1-97.5%)x (250+1)-1 = 5.275 | |||
| Simple | (1-97.5%)x 250 = 6.25 |
- =
- =
- =
- =
- =
- as the value of the sorted P&L vector at rank
- as the value of the sorted P&L vector at rank
- as the value of the sorted P&L vector at rank
- as the value of the sorted P&L vector at rank
VaR approximation
The value of the level[Rounding].[RoundingMethods].[MethodName] is be used to control the interpolation.
| Property value | Description | Formula for VaR | Example | Notes |
|---|---|---|---|---|
| Floor | Simulated PL for the lower of the adjacent ranks | VaR = | For = 6.25, the PL value at rank 6 is taken as the VaR. | |
| Ceil | Simulated PL for the higher of the adjacent ranks | VaR = | For = 6.25, the PL value at rank 7 is taken as the VaR. | default option |
| Weighted | Simulated PL linearly interpolated between the adjacent ranks | VaR = | For = 6.25, the linear interpolation beween PL value at rank 6 and PL value at rank 7 at the point = 6.25 is taken as the VaR. | |
| Round | Simulated PL for the nearest rank | VaR = | For = 6.25, the PL value at rank 6 is taken as the VaR. | |
| For = 6.75, the PL value at rank 7 is taken as the VaR. | ||||
| For = 7.5, the PL value at rank 8 is taken as the VaR. | ||||
| For = 8.5, the PL value at rank 9 is taken as the VaR. | ||||
| For = 9.5, the PL value at rank 10 is taken as the VaR. | ||||
| Round Even | Simulated PL for the nearest rank with rounding half to even | VaR = | For = 6.25, the PL value at rank 6 is taken as the VaR. | |
| For = 6.75, the PL value at rank 7 is taken as the VaR. | ||||
| For = 7.5, the PL value at rank 8 is taken as the VaR. | ||||
| For = 8.5, the PL value at rank 9 is taken as the VaR. | ||||
| For = 9.5, the PL value at rank 10 is taken as the VaR. |