1. Arthur CHARPENTIER - Nonparametric quantile estimation.
Estimating quantiles
and related risk measures
Arthur Charpentier
arthur.charpentier@univ-rennes1.fr
S´minaire du GREMAQ, D´cembre 2007
e e
joint work with Abder Oulidi, IMA Angers
1
2. Arthur CHARPENTIER - Nonparametric quantile estimation.
Agenda
• General introduction
Risk measures
• Distorted risk measures
• Value-at-Risk and related risk measures
Quantile estimation : classical techniques
• Parametric estimation
• Semiparametric estimation, extreme value theory
• Nonparametric estimation
Quantile estimation : use of Beta kernels
• Beta kernel estimation
• Transforming observations
A simulation based study
2
3. Arthur CHARPENTIER - Nonparametric quantile estimation.
Agenda
• General introduction
Risk measures
• Distorted risk measures
• Value-at-Risk and related risk measures
Quantile estimation : classical techniques
• Parametric estimation
• Semiparametric estimation, extreme value theory
• Nonparametric estimation
Quantile estimation : use of Beta kernels
• Beta kernel estimation
• Transforming observations
A simulation based study
3
4. Arthur CHARPENTIER - Nonparametric quantile estimation.
Risk measures and price of a risk
Pascal, Fermat, Condorcet, Huygens, d’Alembert in the XVIIIth century
proposed to evaluate the “produit scalaire des probabilit´s et des gains”,
e
n
< p, x >= pi xi = EP (X),
i=1
based on the “r`gle des parties”.
e
For Qu´telet, the expected value was, in the context of insurance, the price that
e
guarantees a financial equilibrium.
From this idea, we consider in insurance the pure premium as EP (X). As in
Cournot (1843), “l’esp´rance math´matique est donc le juste prix des chances”
e e
(or the “fair price” mentioned in Feller (1953)).
4
5. Arthur CHARPENTIER - Nonparametric quantile estimation.
Risk measures : the expected utility approach
Ru (X) = u(x)dP = P(u(X) > x))dx
where u : [0, ∞) → [0, ∞) is a utility function.
Example with an exponential utility, u(x) = [1 − e−αx ]/α,
1
Ru (X) = log EP (eαX ) .
α
5
6. Arthur CHARPENTIER - Nonparametric quantile estimation.
Risk measures : Yarri’s dual approach
Rg (X) = xdg ◦ P = g(P(X > x))dx
where g : [0, 1] → [0, 1] is a distorted function.
Example
– if g(x) = I(X ≥ 1 − α) Rg (X) = V aR(X, α),
– if g(x) = min{x/(1 − α), 1} Rg (X) = T V aR(X, α) (also called expected
shortfall), Rg (X) = EP (X|X > V aR(X, α)).
6
7. Arthur CHARPENTIER - Nonparametric quantile estimation.
Distortion of values versus distortion of probabilities
Calcul de l’esperance mathématique
1.0
0.8
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6
Fig. 1 – Expected value xdFX (x) = P(X > x)dx.
7
8. Arthur CHARPENTIER - Nonparametric quantile estimation.
Distortion of values versus distortion of probabilities
Calcul de l’esperance d’utilité
1.0
0.8
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6
Fig. 2 – Expected utility u(x)dFX (x).
8
9. Arthur CHARPENTIER - Nonparametric quantile estimation.
Distortion of values versus distortion of probabilities
Calcul de l’intégrale de Choquet
1.0
0.8
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6
Fig. 3 – Distorted probabilities g(P(X > x))dx.
9
10. Arthur CHARPENTIER - Nonparametric quantile estimation.
Distorted risk measures and quantiles
1 −1
Equivalently, note that E(X) = 0
FX (1 − u)du, and
1 −1
Rg (X) = 0
FX (1 − u)dgu.
A very general class of risk measures can be defined as follows,
1
−1
Rg (X) = FX (1 − u)dgu
0
where g is a distortion function, i.e. increasing, with g(0) = 0 and g(1) = 1.
Note that g is a cumulative distribution function, so Rg (X) is a weighted sum of
quantiles, where dg(1 − ·) denotes the distribution of the weights.
10
12. Arthur CHARPENTIER - Nonparametric quantile estimation.
Agenda
• General introduction
Risk measures
• Distorted risk measures
• Value-at-Risk and related risk measures
Quantile estimation : classical techniques
• Parametric estimation
• Semiparametric estimation, extreme value theory
• Nonparametric estimation
Quantile estimation : use of Beta kernels
• Beta kernel estimation
• Transforming observations
A simulation based study
12
13. Arthur CHARPENTIER - Nonparametric quantile estimation.
Using a parametric approach
−1
If FX ∈ F = {Fθ , θ ∈ Θ} (assumed to be continuous), qX (α) = Fθ (α), and thus,
a natural estimator is
qX (α) = F −1 (α), (1)
θ
where θ is an estimator of θ (maximum likelihood, moments estimator...).
13
14. Arthur CHARPENTIER - Nonparametric quantile estimation.
Using the Gaussian distribution
A natural idea (that can be found in classical financial models) is to assume
Gaussian distributions : if X ∼ N (µ, σ), then the α-quantile is simply
q(α) = µ + Φ−1 (α)σ,
where Φ−1 (α) is obtained in statistical tables (or any statistical software), e.g.
u = −1.64 if α = 90%, or u = −1.96 if α = 95%.
Definition 1. Given a n sample {X1 , · · · , Xn }, the (Gaussian) parametric
estimation of the α-quantile is
qn (α) = µ + Φ−1 (α)σ,
14
15. Arthur CHARPENTIER - Nonparametric quantile estimation.
Using a parametric models
Actually, is the Gaussian model does not fit very well, it is still possible to use
Gaussian approximation
If the variance is finite, (X − E(X))/σ might be closer to the Gaussian
distribution, and thus, consider the so-called Cornish-Fisher approximation, i.e.
Q(X, α) ∼ E(X) + zα V (X), (2)
where
2
ζ1 −1 2 ζ2 −1 3 ζ1
zα = Φ (α)+ [Φ (α) −1]+ [Φ (α) −3Φ (α)]− [2Φ−1 (α)3 −5Φ−1 (α)],
−1 −1
6 24 36
(3)
where ζ1 is the skewness of X, and ζ2 is the excess kurtosis, i.e. i.e.
E([X − E(X)]3 ) E([X − E(X)]4 )
ζ1 = 2 )3/2
and ζ1 = 2 )2
− 3. (4)
E([X − E(X)] E([X − E(X)]
15
16. Arthur CHARPENTIER - Nonparametric quantile estimation.
Using a parametric models
Definition 2. Given a n sample {X1 , · · · , Xn }, the Cornish-Fisher estimation of
the α-quantile is
n n
1 1 2
qn (α) = µ + zα σ, where µ = Xi and σ = (Xi − µ) ,
n i=1
n−1 i=1
and
2
−1 ζ1 −1 2 ζ2 −1 3 ζ1
zα = Φ (α)+ [Φ (α) −1]+ [Φ (α) −3Φ (α)]− [2Φ−1 (α)3 −5Φ−1 (α)],
−1
6 24 36
where ζ1 is the natural estimator for the skewness of X, and ζ2 is the natural
√
n(n − 1) n n (Xi − µ)3
i=1
estimator of the excess kurtosis, i.e. ζ1 = 3/2
and
n−2 ( n
(Xi − µ)2 ) i=1
n 4
n−1 n i=1 (Xi −µ)
ζ2 = (n−2)(n−3) (n + 1)ζ2 + 6 where ζ2 = n 2 − 3.
( i=1 (Xi −µ)2)
16
17. Arthur CHARPENTIER - Nonparametric quantile estimation.
Parametrics estimator and error model
Density, theoritical versus empirical Density, theoritical versus empirical
0.8
0.3
0.6
Theoritical Student
Theoritical lognormal Fitted lStudent
Fitted lognormal
0.2
Fitted Gaussian
Fitted gamma
0.4
0.1
0.2
0.0
0.0
0 1 2 3 4 5 −4 −2 0 2 4
Fig. 5 – Estimation of Value-at-Risk, model error.
17
18. Arthur CHARPENTIER - Nonparametric quantile estimation.
Using a semiparametric models
Given a n-sample {Y1 , . . . , Yn }, let Y1:n ≤ Y2:n ≤ . . .≤ Yn:n denotes the associated
order statistics.
If u large enough, Y − u given Y > u has a Generalized Pareto distribution with
parameters ξ and β ( Pickands-Balkema-de Haan theorem)
If u = Yn−k:n for k large enough, and if ξ> 0, denote by βk and ξk maximum
likelihood estimators of the Genralized Pareto distribution of sample
{Yn−k+1:n − Yn−k:n , ..., Yn:n − Yn−k:n },
βk n − ξk
Q(Y, α) = Yn−k:n + (1 − α) −1 , (5)
ξk k
An alternative is to use Hill’s estimator if ξ > 0,
− ξk k
n 1
Q(Y, α) = Yn−k:n (1 − α) , ξk = log Yn+1−i:n − log Yn−k:n . (6)
k k i=1
18
19. Arthur CHARPENTIER - Nonparametric quantile estimation.
On nonparametric estimation for quantiles
−1
For continuous distribution q(α) = FX (α), thus, a natural idea would be to
−1
consider q(α) = FX (α), for some nonparametric estimation of FX .
Definition 3. The empirical cumulative distribution function Fn , based on
n
1
sample {X1 , . . . , Xn } is Fn (x) = 1(Xi ≤ x).
n i=1
Definition 4. The kernel based cumulative distribution function, based on
sample {X1 , . . . , Xn } is
n x n
1 Xi − t 1 Xi − x
Fn (x) = k dt = K
nh i=1 −∞ h n i=1
h
x
where K(x) = k(t)dt, k being a kernel and h the bandwidth.
−∞
19
20. Arthur CHARPENTIER - Nonparametric quantile estimation.
Smoothing nonparametric estimators
Two techniques have been considered to smooth estimation of quantiles, either
implicit, or explicit.
• consider a linear combinaison of order statistics,
The classical empirical quantile estimate is simply
−1 i
Qn (p) = Fn = Xi:n = X[np]:n where [·] denotes the integer part. (7)
n
The estimator is simple to obtain, but depends only on one observation. A
natural extention will be to use - at least - two observations, if np is not an
integer. The weighted empirical quantile estimate is then defined as
Qn (p) = (1 − γ) X[np]:n + γX[np]+1:n where γ = np − [np].
20
21. Arthur CHARPENTIER - Nonparametric quantile estimation.
The quantile function in R The quantile function in R
7
q q qq
qq
qq
type=1 q q
8
type=1 qq
type=3 qq
qqq
6
type=3
type=5 qq
type=5 qqqq
qq
type=7 qq
type=7
q
qqqqq
qqqq
6
5
qqqq
qq
quantile level
quantile level
qqq
q
qqqq
q
qq
q q qqq
q
qqq
q
qqqq
qq
4
qqq
q
qq
4
qq
qqqq
qq
qqq
q
3
qq
qqq
qq
q q
2
qq
2
qq
q q qq
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
probability level probability level
Fig. 6 – Several quantile estimators in R.
21
22. Arthur CHARPENTIER - Nonparametric quantile estimation.
Smoothing nonparametric estimators
In order to increase efficiency, L-statistics can be considered i.e.
n n 1
−1 i −1
Qn (p) = Wi,n,p Xi:n = Wi,n,p Fn = Fn (t) k (p, h, t) dt (8)
i=1 i=1
n 0
where Fn is the empirical distribution function of FX , where k is a kernel and h a
bandwidth. This expression can be written equivalently
n i n i i−1
n t−p n −p n −p
Qn (p) = k dt X(i) = IK − IK X(i)
i=1
(i−1)
n
h i=1
h h
(9)
x
where again IK (x) = k (t) dt. The idea is to give more weight to order
−∞
statistics X(i) such that i is closed to pn.
22
23. Arthur CHARPENTIER - Nonparametric quantile estimation.
3
2
1
0
0.0 0.2 0.4 0.6 0.8 1.0
quantile (probability) level
Fig. 7 – Quantile estimator as wieghted sum of order statistics.
23
24. Arthur CHARPENTIER - Nonparametric quantile estimation.
3
2
1
0
0.0 0.2 0.4 0.6 0.8 1.0
quantile (probability) level
Fig. 8 – Quantile estimator as wieghted sum of order statistics.
24
25. Arthur CHARPENTIER - Nonparametric quantile estimation.
3
2
1
0
0.0 0.2 0.4 0.6 0.8 1.0
quantile (probability) level
Fig. 9 – Quantile estimator as wieghted sum of order statistics.
25
26. Arthur CHARPENTIER - Nonparametric quantile estimation.
3
2
1
0
0.0 0.2 0.4 0.6 0.8 1.0
quantile (probability) level
Fig. 10 – Quantile estimator as wieghted sum of order statistics.
26
27. Arthur CHARPENTIER - Nonparametric quantile estimation.
3
2
1
0
0.0 0.2 0.4 0.6 0.8 1.0
quantile (probability) level
Fig. 11 – Quantile estimator as wieghted sum of order statistics.
27
28. Arthur CHARPENTIER - Nonparametric quantile estimation.
Smoothing nonparametric estimators
E.g. the so-called Harrell-Davis estimator is defined as
n i
n Γ(n + 1)
Qn (p) = y (n+1)p−1 (1 − y)(n+1)q−1 Xi:n ,
i=1
(i−1)
n
Γ((n + 1)p)Γ((n + 1)q)
• find a smooth estimator for FX , and then find (numerically) the inverse,
The α-quantile is defined as the solution of FX ◦ qX (α) = α.
If Fn denotes a continuous estimate of F , then a natural estimate for qX (α) is
qn (α) such that Fn ◦ qn (α) = α, obtained using e.g. Gauss-Newton algorithm.
28
29. Arthur CHARPENTIER - Nonparametric quantile estimation.
Agenda
• General introduction
Risk measures
• Distorted risk measures
• Value-at-Risk and related risk measures
Quantile estimation : classical techniques
• Parametric estimation
• Semiparametric estimation, extreme value theory
• Nonparametric estimation
Quantile estimation : use of Beta kernels
• Beta kernel estimation
• Transforming observations
A simulation based study
29
30. Arthur CHARPENTIER - Nonparametric quantile estimation.
Kernel based estimation for bounded supports
Classical symmetric kernel work well when estimating densities with
non-bounded support,
n
1 x − Xi
fh (x) = k ,
nh i=1
h
where k is a kernel function (e.g. k(ω) = I(|ω| ≤ 1)/2).
If K is a symmetric kernel, note that
1
E(fh (0) = f (0) + O(h)
2
30
31. Arthur CHARPENTIER - Nonparametric quantile estimation.
Kernel based estimation of the uniform density on [0,1] Kernel based estimation of the uniform density on [0,1]
1.2
1.2
1.0
1.0
0.8
0.8
Density
Density
0.6
0.6
0.4
0.4
0.2
0.2
0.0
0.0
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
Fig. 12 – Density estimation of an uniform density on [0, 1].
31
32. Arthur CHARPENTIER - Nonparametric quantile estimation.
Kernel based estimation for bounded supports
Several techniques have been introduce to get a better estimation on the border,
– boundary kernel (Muller (1991))
¨
– mirror image modification (Deheuvels & Hominal (1989), Schuster
(1985))
– transformed kernel (Devroye & Gyrfi (1981), Wand, Marron &
Ruppert (1991))
– Beta kernel (Brown & Chen (1999), Chen (1999, 2000)),
see Charpentier, Fermanian & Scaillet (2006) for a survey with
application on copulas.
32
33. Arthur CHARPENTIER - Nonparametric quantile estimation.
Beta kernel estimators
A Beta kernel estimator of the density (see Chen (1999)) - on [0, 1] is
n
1 x 1−x
fb (x) = k Xi , 1 + , 1 + , x ∈ [0, 1],
n i=1
b b
uα−1 (1 − u)β−1
where k(u, α, β) = , u ∈ [0, 1].
B(α, β)
If {X1 , · · · , Xn } are i.i.d. variables with density f0 , if n → ∞, b → 0, then
Bouzmarni & Scaillet (2005)
fb (x) → f0 (x), x ∈ [0, 1].
This is the Beta 1 estimator.
33
35. Arthur CHARPENTIER - Nonparametric quantile estimation.
Improving Beta kernel estimators
Problem : the convergence is not uniform, and there is large second order bias
on borders, i.e. 0 and 1.
Chen (1999) proposed a modified Beta 2 kernel estimator, based on
k t , 1−t (u) , if t ∈ [2b, 1 − 2b]
b b
k2 (u; b; t) = k 1−t (u) , if t ∈ [0, 2b)
ρb (t), b
k b ,ρb (1−t) (u) , if t ∈ (1 − 2b, 1]
t
t
where ρb (t) = 2b2 + 2.5 − 4b4 + 6b2 + 2.25 − t2 − .
b
35
36. Arthur CHARPENTIER - Nonparametric quantile estimation.
Non-consistency of Beta kernel estimators
Problem : k(0, α, β) = k(1, α, β) = 0. So if there are point mass at 0 or 1, the
estimator becomes inconsistent, i.e.
1 x 1−x
fb (x) = k Xi , 1 + , 1 + , x ∈ [0, 1]
n b b
1 x 1−x
= k Xi , 1 + , 1 + , x ∈ [0, 1]
n b b
Xi =0,1
n − n0 − n1 1 x 1−x
= k Xi , 1 + , 1 + , x ∈ [0, 1]
n n − n0 − n1 b b
Xi =0,1
≈ (1 − P(X = 0) − P(X = 1)) · f0 (x), x ∈ [0, 1]
and therefore Fb (x) ≈ (1 − P(X = 0) − P(X = 1)) · F0 (x), and we may have
problem finding a 95% or 99% quantile since the total mass will be lower.
36
37. Arthur CHARPENTIER - Nonparametric quantile estimation.
Non-consistency of Beta kernel estimators
Gourieroux & Monfort (2007) proposed
´
(1) fb (x)
fb (x) = 1 , for all x ∈ [0, 1].
0
fb (t)dt
It is called macro-β since the correction is performed globally.
Gourieroux & Monfort (2007) proposed
´
n
(2) 1 kβ (Xi ; b; x)
fb (x) = 1 , for all x ∈ [0, 1].
n i=1 kβ (Xi ; b; t)dt
0
It is called micro-β since the correction is performed locally.
37
38. Arthur CHARPENTIER - Nonparametric quantile estimation.
Transforming observations ?
In the context of density estimation, Devroye and Gy¨
’orfi (1985) suggested
to use a so-called transformed kernel estimate
Given a random variable Y , if H is a strictly increasing function, then the
p-quantile of H(Y ) is equal to H(q(Y ; p)).
An idea is to transform initial observations {X1 , · · · , Xn } into a sample
{Y1 , · · · , Yn } where Yi = H(Xi ), and then to use a beta-kernel based estimator, if
H : R → [0, 1]. Then qn (X; p) = H −1 (qn (Y ; p)).
In the context of density estimation fX (x) = fY (H(x))H (x). As mentioned in
Devroye and Gyorfi (1985) (p 245), “for a transformed histogram histogram
¨
estimate, the optimal H gives a uniform [0, 1] density and should therefore be
equal to H(x) = F (x), for all x”.
38
39. Arthur CHARPENTIER - Nonparametric quantile estimation.
Transforming observations ? a monte carlo study
Assume that sample {X1 , · · · , Xn } have been generated from Fθ0 (from a familly
F = (Fθ , θ ∈ Θ). 4 transformations will be considered
– H = Fθ (based on a maximum likelihood procedure)
– H = Fθ0 (theoritical optimal transformation)
– H = Fθ with θ < θ0 (heavier tails)
– H = Fθ with θ > θ0 (lower tails)
39