Quantile Estimation – sample quantiles versus kernel quantiles

Quantile Estimation – sample quantiles
versus kernel quantiles
PillarOne Conference, St. Gallen, September 10, 2010
Jessika Walter, PhD, Intuitive Collaboration
Markus Stricker, PhD, Intuitive Collaboration
Introduction
• VaR, TVaR/CVaR is one of the most frequently used key figures in risk
management
• Solvency II: VaR 99.5%
• SST: TVaR 99%
• Most partial-internal and internal risk management models are Monte-Carlo
simulation models
• VaR has to be estimated from simulated samples
Everybody talks about modeling, but
• Are the key figures derived from the samples stable?
• Are they biased?
• How do they converge?
Ultimate goal
• Derive confidence intervals for VaR
• Derive criteria for required sample sizes, i.e. required number of iterations
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
2
Content
ƒ Sample quantile estimators:
ƒ Definitions
ƒ Asymptotic considerations
ƒ Kernel quantile estimators:
ƒ Kernel density estimation
ƒ Selecting the appropriate bandwidth
ƒ Sample quantiles versus kernel estimators technique
ƒ Conclusion and outlook
PillarOne – Result Analysis and Reporting
April 2, 2009
3
Quantile function
Probability function f ( x) :
∫ f ( x)dx = 1,
f ≥0
Cumulative distribution F ( x) :
x
F ( x) = ∫ f ( y )dy
Q p = 0.8
−∞
Interpreta tion : X ∝ f ( x)dx ⇒ P[ X ∈ (a, b]] = F (b) − F (a )
Quantile function Q p is defined as the generalized inverse of F
Q p = inf{x ∈ R : P[ X ≤ x] ≥ p}
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
4
Sample quantile
Assumption : 1. X 1,X 2 ,...,X N i.i.d. random variables according to X ∝ f(x)dx
2. Let x1,...,x N denote a realization of {X n }n ordered by increasing size
(order statistics)
Prop : Under certain assumption s, as N → ∞ the following is satisfied :
1. The stationary density fˆ (x) of {x } converges to f(x) in L1(dx).
N
n n
2. If Qˆ p denotes a sample quantile, then Qˆ p converges pointwise to the real quantile Q p .
Popular choice :
Qˆ p := x⎣ Np ⎦+1
Note: There is not a unique definition for
sample quantiles and magnitude of
bias highly depends on the specific
choice and the underlying distribution.
Sample quantiles are biased, but asymptotically unbiased:
E[Qˆ p , N ] ≠ Q p for all N ,
PillarOne – Risk Management meets Open Source
lim E[Qˆ p , N ] = Q p
N →∞
Aug. 29, 2008
5
Illustrative Example: variability of sample
quantile
p=0.9
Qˆ p := x⎣ Np ⎦+1
N=10000
f(x) standard lognormal
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
6
Distribution of sample quantile
f(x) is standard gaussian
N=1000
N=1010
N=1022
Qˆ p := x⎣ Np ⎦+1
here: p=0.95
N=1000: Np=950
N=1010: Np=959.50
N=1022: Np=970.90
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
7
Asymptotic behaviour of expectation
N=[100:5:5000],
p=0.95
Qˆ p := x⎣ Np ⎦+1
Np such that Np ϵ Z
Np such that Np ϵ (Z+0.25)
Np such that Np ϵ (Z+0.50)
Np such that Np ϵ (Z+0.75)
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
8
Comparison of sample quantiles (L-estimators)
N=[100:5:500],
p=0.95
QˆU ( p ) := x⎣ Np ⎦+1
Qˆ L ( p ) := x⎣ Np ⎦
linear interpolation between
Qˆ := x
and Qˆ := x
U
⎣ Np ⎦
L
⎣ Np ⎦+1
Estimator of Hyndman and Fan lies between low side and high side
Qˆ HF ( p) := (1 − γ ) x g + γ x g +1
PillarOne – Risk Management meets Open Source
g = ⎣( N + 1 / 3) p + 1 / 3⎦, γ = ( N + 1 / 3) p + 1 / 3 − g
Aug. 29, 2008
9
HF-estimator
L-Estimator of Hyndman and Fan:
Qˆ HF ( p) := (1 − γ ) x g + γ x g +1
g = ⎣( n + 1 / 3) p + 1 / 3⎦, γ = (n + 1 / 3) p + 1 / 3 − g
Example with p=0.95:
1. N = 100 ⇒ Np = 95
Then p/3+1/3 = 0.65
⇒
3. N = 110 ⇒ Np = 104.5 ⇒
Qˆ HF = 0.35 x95 + 0.65 x96
Qˆ HF = 0.60 x100 + 0.40 x101
Qˆ = 0.85 x + 0.15 x
4. N = 115 ⇒ Np = 109.25 ⇒
Qˆ HF = 0.10 x109 + 0.90 x110
2. N = 105 ⇒ Np = 99.75 ⇒
PillarOne – Risk Management meets Open Source
HF
105
106
Aug. 29, 2008
10
Standard error of sample quantiles
N=[100:5:5000],
p=0.95
Qˆ p := x⎣ Np ⎦+1
Qˆ p := x⎣ Np ⎦
Bahadur representation:
PillarOne – Risk Management meets Open Source
d
Qˆ p → N (Q p ,
σ2
N
)
with
σ=
p(1 − p)
f (Q p )
Aug. 29, 2008
11
Kernel density estimation
Let x1,x2 ,...,x N denote a sample of size N from a random variable with density f
Kernel density estimate:
N
1
⎛ x − xi ⎞
fˆN ( x) = ∑ K ⎜
⎟
Nh i =1 ⎝ h ⎠
Kernel K is nonnegative, bounded, Lipschitz function with
∫ K ( y)dy = 1,
∫ yK ( y)dy = 0,
Gaussian Kernel :
K ( y) =
1
exp(− y 2 / 2)
2π
2
2
y
K
(
y
)
dy
=
σ
>0
∫
Convergenc e assumption :
lim h = 0,
N →∞
lim ( Nh) = ∞
N →∞
What is the optimal bandwidth h?
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
12
Optimal global bandwidth
N=1000, f(x)=N(0,1)
slight oversmoothing
undersmoothing for
for h=0.27
h=0.05
hopt = hopt ( I ( K ), I (( f ' ' ) ), N ) = O( N
2
2
−1 / 5
)
The optimal bandwidth minimizes the asymptotic mean
integrated squared error
MISE = ∫ Bias( fˆh ( y )) 2 dy + ∫ Var ( fˆh ( y ))dy
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
13
Illustrative Example: Optimal global bandwidth
for standard Gaussian
N=1000
N=5000
N=50000
h=0.27
h=0.19
h=0.12
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
14
Illustrative Example: Optimal global bandwidth
for standard lognormal distribution
N=1000
N=5000
N=50000
h=0.05
h=0.036
h=0.023
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
15
Distribution of kernel quantile estimator
with global bandwidth
σ = 0.075
σ = 0.094
Bad news:
Optimal bandwidth for minimizing
error in Lebesgue space is not a
good candidate for quantile estimation
Good news: There exists a locally adapted optimal bandwidth for quantile estimation
h p = h p ( f (Q p ), f ' (Q p ), N ) = O( N −1/ 3 )
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
16
Illustrative Example: Optimal local bandwidth for
p=0.9 applied to standard Gaussian sample
N=1000
hopt = 0.27
h p = 0.125
PillarOne – Risk Management meets Open Source
N=5000
N=50000
hopt = 0.19
hopt = 0.12
h p = 0.073
h p = 0.034
Aug. 29, 2008
17
Illustrative Example: Optimal local bandwidth for
p=0.9 applied to standard Lognormal sample
N=1000
N=50000
N=5000
hopt = 0.05
h p = 0.306
PillarOne – Risk Management meets Open Source
hopt = 0.036
h p = 0.180
hopt = 0.023
h p = 0.130
Aug. 29, 2008
18
Asymptotic behaviour of kernel quantile
estimators versus sample quantiles
f(x) standard Gaussian, p=0.95
d
Qˆ ker nel → N (Q p ,
σ2
N
),
σ=
PillarOne – Risk Management meets Open Source
p (1 − p )
f (Q p )
Aug. 29, 2008
19
Conclusions and forthcoming considerations
• Sample quantiles are biased and magnitude and direction
depends on the selected estimator
• To reduce systematic errors use L-estimators that use at least two observations
• There are L-estimators that include three or more observations: one of them mixes
L-estimation with kernel density estimation
Kernel smoothing the order statistics :
N
Qˆ p , N := ∑ xi
i =1
i
n
1 ⎛ p−x⎞
∫i −1 h K ⎜⎝ h ⎟⎠dx
n
strongly depends on choosing the optimal bandwidth
one of the next tasks !!!
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
20
Forthcoming considerations
• Derivation of stopping criteria for required sample size:
Let ε and confidence level 1-α be given :
N such that for all N ≥ N we have Qˆ ∈ [Q
0
0
p
p −ε
, Q p +ε ]
Here, the crucial problem is to estimate the function value at the quantile
All of the results will be considered for the implementation
in Pillar One!
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
21
Contacts
Dr. Markus Stricker; Partner, Managing Director
+41 44 926 10 88; +41 76 423 26 67
[email protected]
Dr. Jessika Walter; Consultant, Actuarial Consulting
+41 44 926 14 07; +41 79 364 83 62
[email protected]
Intuitive Collaboration AG; Seestrasse 16; CH-8712 Staefa
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
22
Appendix: asymptotic results for lognormal
PillarOne – Risk Management meets Open Source
Aug. 29, 2008
23
Asymptotic behaviour of expectations of sample
quantiles for standard Lognormal
QˆU ( p ) := x⎣ Np ⎦+1
Qˆ L ( p ) := x⎣ Np ⎦
linear interpolation between
Qˆ := x
and Qˆ := x
U
Qˆ HF ( p ) := (1 − γ ) x g + γ x g +1
PillarOne – Risk Management meets Open Source
⎣ Np ⎦
L
⎣ Np ⎦+1
g = ⎣( N + 1 / 3) p + 1 / 3⎦, γ = ( N + 1 / 3) p + 1 / 3 − g
Aug. 29, 2008
24
Standard error of sample quantiles for standard
lognormal
N=[100:5:5000 6000 8000 10000],
p=0.95
Qˆ p := x⎣ Np ⎦+1
Qˆ p := x⎣ Np ⎦
Bahadur representation:
PillarOne – Risk Management meets Open Source
d
Qˆ p → N (Q p ,
σ2
N
)
with
σ=
p (1 − p )
f (Q p )
Aug. 29, 2008
25
Asymptotic behaviour of kernel quantile
estimators versus sample quantiles
f(x) standard Lognormal, p=0.95
d
Qˆ ker nel → N (Q p ,
σ2
N
),
σ=
PillarOne – Risk Management meets Open Source
p (1 − p )
f (Q p )
Aug. 29, 2008
26