2.2.4.1. Empirical computation
For a given probability \(p\), the corresponding quantile \(q\) is given by:
where \(x_k\) is the k-Th smallest value of the variable set-of-value (whose size is \(N\)).
The way the index \(k\) is computed depends on how conservative one wants to be, but also on the case under consideration. For discontinuous cases, one can choose amongst the following list:
\(k=\lfloor p\times N \rfloor; \; {\rm if} \; p \times N = k,\; q = x_k. \; q=x_{k+1}\; {\rm otherwise.}\)
\(k=\lfloor p\times N \rfloor; \; {\rm if} \; p \times N = k,\; q = 1/2 \times (x_k+x_{k+1}). \; q=x_{k+1} \; {\rm otherwise.}\)
\(k=\lfloor p \times N - 0.5 \rfloor; \; {\rm if} \; p \times N -0.5 = k \; {\rm and} \; k \; {\rm is \; even},\; q = x_k. \; q=x_{k+1} \; {\rm otherwise.}\)
For piece-wise linear interpolations, the estimation of k can be done in Uranie amongst the following cases:
\(k=\lfloor p \times N\rfloor\)
\(k=\lfloor p \times N - 0.5\rfloor\)
\(k=\lfloor p \times (N + 1) \rfloor\)
\(k=\lfloor p \times (N - 1) + 1 \rfloor\)
\(k=\lfloor p \times (N + 1/3) + 1/3 \rfloor\), approximately median unbiased.
\(k=\lfloor p \times (N + 1/4) + 3/8 \rfloor\), approximately unbiased if \(x\) is normally distributed.