6.2 Extreme value approach to VaR
Extreme value theory (EVT) deals with the analysis and modelling of extreme values, which are typically caused by unpredictable, rare, but significant events
Two kinds of extreme values are possible: extreme gains (positive side of the distribution) and extreme losses (negative side). Extreme losses are in the main focus of risk management, so we are analyzing the negative returns with respect to convention to large losses instead of negative profits
There are several methods to modelling, with the most common being POT (Peak Over Threshold), which focuses on estimating the distribution of the extreme losses above a certain threshold level
The distribution of daily stock or portfolio losses, however, generally has fatter tails than the normal distribution so that VaR and ES may be severely under–estimated
The POT methodology estimates the distribution of losses over a threshold (so called tail distribution) and produces more reliable estimates of VaR and ES
Distribution of excess losses y can be approximated by generalized Pareto distribution (GPD) with cumulative distribution function (cdf) as given
F(y)={1−(1+ξyβ)−1/ξ,if ξ≠01−exp(−yβ),if ξ=0
If variable x represents the losses (a negative returns are transformed to positive numbers), then variable y=x−u represents the excess losses (extreme losses over some threshold u, so called exceedances). For a given threshold u generalized Pareto distribution depends on two parameters ξ and β which are estimated by maximum likelihood method (MLE)
ξ is the shape parameter (ξ>0 indicates heavy tails behavior, for ξ=0 the GPD is exponential distribution – indicating thin tails, while for ξ<0 a Pareto type II distribution is considered with bounded tails)
β is the scale parameter
Therefore, a QQ–plot with the exponential distribution as the reference distribution for the negative returns over the threshold should be created (departures from the reference line in the QQ–plot indicates either fat tails behavior or bounded tails
Still, the main concern is to determine a threshold parameter u
For every threshold u a mean excess over that same threshold can be calculate, i.e. the mean excess that depends on the threshold. Accordingly, mean excess plot is used to present the mean excess over threshold as a function of u that can be determined empirically as
me(u)=1nunu∑i=1yi
A negative slope of me(u) indicates thin–tailed behavior, whereas a positive slope indicates a heavy–tailed behavior
The shape parameter ξ, or equivalently, the tail index 1/ξ, of the GPD distribution may be estimated non–parametrically in a number of ways, but will not be considered here
Solution
Copy the code lines below to the clipboard, paste them into an R Script file, and run them.# Installing an loading package "evir"
install.packages("evir")
library(evir)
# Extract only negative returns and convert them to positive (losses are treated as positive numbers)
# This is done to simplify further calculations when applicable
<- meta_returns[meta_returns < 0]
neg_only <- -neg_only
losses length(losses) # number of losses (485)
# Mean excess plot is a straight line with positive slope above a certain threshold
meplot(losses)
# Save mean excess plot output to an object for further inspection if needed
<- meplot(losses)
meplot_output
meplot_output
# Mean excess plot suggest a threshold around 0.04
sum(losses > 0.04) # how many losses are above threshold
<- findthresh(losses, 54) # exact threshold with 54 exceedances
threshold
threshold
54/485*100 # exceedances rate
# Create QQ-plot with exponential distribution as the reference
# Convex deviation from linearity suggests heavy-tailed behavior
qplot(losses, threshold = threshold)
# Fit a generalized Pareto distribution (GPD) to the 54 exceedances over the threshold
<- gpd(losses, threshold = threshold, method = "ml")
pareto "par.ests"]] # estimated parameters
pareto[[print(pareto) # print all results
plot(pareto) # diagnostic plots for evaluating the goodness of fit
# Plot the shape parameter over a range of thresholds to assess its stability
shape(losses)
# Tail plot for visualizing exceedances and model fit
tailplot(pareto) # the same as the second plot from selection
# Compute Value at Risk (VaR) and Expected Shortfall (ES)
# at 95% and 99% confidence levels based on fitted GPD parameters
riskmeasures(pareto, c(0.95, 0.99))