In this subsection the GPD distribution is fitted to the daily losses of Boeing stock by utilizing the POT method. The closing prices for this stock are contained in the objectDowJones30which is part of thefBasicspackage (see Würtz et al. 2014).
The sample runs from 31 December 1990 to 2 January 2001 and comprises 2529 observations.
In Listing 7.3 the necessary packages are loaded first. The packagefExtremeswill be used to conduct the analysis. Next, the data set is loaded into the workspace and is converted to atimeSeriesobject. The daily losses of Boeing are computed and expressed as percentage figures. The resulting object has been termedBALoss.
To apply the POT method, a suitable threshold value must be determined. This choice can be guided by the MRL plot which is shown in Figure 7.8. In this graph 95%
confidence bands around the mean excesses have been superimposed and are colored light gray. Unfortunately, and this is often encountered empirically, a definite choice for the threshold value can hardly be deduced from this kind of plot. However, it seems reasonable to assume a daily loss as high as 3% as a threshold value, given that a linear relationship exists between the plotted thresholds and the mean excesses above this value. In principle, a threshold slightly higher or lower than 3% could be chosen, but then there is a trade-off between greater uncertainty for the estimates and bias. For the given threshold a total of 102 exceedances result. This data set corresponds roughly to the upper 96% quantiles of the empirical distribution function.
k k Having fixed the threshold value, the GPD can be fitted to the exceedances. This
is accomplished with the functiongpdFit(). The estimates for the scale and shape parameters as well as their estimated standard deviations are shown in Table 7.3. The shape parameter is greater than zero and significantly different from one, indicating heavy tails.
In addition to the estimate, the appropriateness of the fitted model can be investi- gated graphically by means of theplot()method for objects of classfGPDFIT.
Figure 7.9 shows the diagnostic plots obtained. The upper panels show the fitted excess distribution and a tail plot. Both indicate a good fit of the GPD to the ex- ceedances. The lower panels display the residuals with a fitted ordinary least-squares (OLS) line on the left and a QQ plot on the right. Neither plot gives cause for concern as to a size effect; that is to say, the OLS line stays fairly flat and in the QQ plot the points plotted do not deviate much from the diagonal.
Finally, point estimates for the VaR and ES risk measures can be swiftly computed with the functionGPDRiskMeasures(). In Listing 7.3 these are computed for the 95%, 99%, and 99.5% levels. The results are shown in Table 7.4. These measures would qualify as unconditional risk assessments for the next business day.
In the example above it was implicitly assumed that the exceedances are iid data points. However, this assumption is barely tenable for financial market returns. In particular, given the validity of the stylized facts, returns large in absolute value are clustered with respect to time and this empirical characteristic also holdscum grano salisfor losses that exceed a high value chosen as a threshold. The focus is now shifted to the time domain of the exceedances, called marks, rather than the actual values.
The issue raised here is exemplified in Listing 7.4 by employing the daily returns of the New York Stock Exchange Index.
First, the necessary packages fBasics and fExtremes are loaded into the workspace. Next, the daily continuous losses of the stock index are computed and expressed as percentages. The data for exceedances above the 95th percentile are recovered from the losses with the function pointProcess(). This function returns an object with the time stamps and marks, that is, the losses above the threshold. For an iid point process the time gaps between consecutive exceedances should be Poisson distributed. This can easily be checked by means of an appropriate QQ plot. Another graphical means to detect departure from the iid assumption is to portray the ACF and/or PACF of the gaps. If the exceedances occurred randomly during the sample period, the gaps should not be autocorrelated. Such graphs are shown in Figure 7.10.
All four graphs indicate that the exceedances cannot be assumed to be iid. The upper left panel shows the point process. It is fairly evident from this graph that the exceedances are clustered. This is mirrored by the QQ plot in the upper right panel.
Here the time gaps between consecutive marks are plotted against a Poisson distribu- tion. The scatter points deviate considerably from the fitted line. The non-randomness of the occurrences is also reflected by the ACF and PACF plot in the lower panel.
The ACF tapers off only slowly and the PACF indicates a significant second-order autocorrelation.
k k
−10 −5 0 5 10
0246810
Mean Residual Live Plot
Threshold: u
Mean Excess: e ci = 0.95
Figure 7.8 MRL plot for Boeing losses.
Table 7.3 Fitted GPD of Boeing.
GPD 𝜉 𝛽
Estimate 0.331 1.047
Standard error 0.128 0.166
5 10 20
0.00.40.8
Excess Distribution
Fu(xưu)
x [log Scale] u = 3
0 20 40 60 80 100
024
Scatterplot of Residuals
Ordering
Residuals
5 10 20
5e−052e−03
Tail of Underlying Distribution
x [log scale]
1−F(x) [log scale]
0 1 2 3 4 5
QQ−Plot of Residuals
Ordered Data
024
Exponential Quantiles
Figure 7.9 Diagnostic plots of fitted GPD model.
k k Table 7.4 Risk measures for Boeing.
Confidence level VaR ES
95.0% 2.783 4.240
99.0% 4.855 7.336
99.5% 6.149 9.268
Rcode 7.4Declustering of NYSE exceedances.
l i b r a r y ( f E x t r e m e s ) 1
l i b r a r y ( f B a s i c s ) 2
d a t a ( n y s e ) 3
NYSELevel <− t i m e S e r i e s ( n y s e [ , 2 ] , 4
c h a r v e c = a s . c h a r a c t e r ( n y s e [ , 1 ] ) ) 5
NYSELoss <− na . o m i t (−1 . 0 ∗ d i f f ( l o g ( NYSELevel ) ) ∗ 1 0 0 ) 6
c o l n a m e s ( NYSELoss ) <− " NYSELoss " 7
# # P o i n t p r o c e s s d a t a 8
NYSEPP <− p o i n t P r o c e s s ( x = NYSELoss , 9
u = q u a n t i l e ( NYSELoss , 0 . 9 5 ) ) 10
# # D e c l u s t e r i n g 11
DC05 <− d e C l u s t e r ( x = NYSEPP , r u n = 5 , d o p l o t = FALSE ) 12
DC10 <− d e C l u s t e r ( x = NYSEPP , r u n = 1 0 , d o p l o t = FALSE ) 13
DC20 <− d e C l u s t e r ( x = NYSEPP , r u n = 2 0 , d o p l o t = FALSE ) 14
DC40 <− d e C l u s t e r ( x = NYSEPP , r u n = 4 0 , d o p l o t = FALSE ) 15
DC60 <− d e C l u s t e r ( x = NYSEPP , r u n = 6 0 , d o p l o t = FALSE ) 16
DC120 <− d e C l u s t e r ( x = NYSEPP , r u n = 1 2 0 , d o p l o t = FALSE ) 17
# # F i t o f d e c l u s t e r e d d a t a 18
DC05Fit <− g p d F i t ( DC05 , u = min ( DC05 ) ) 19
DC10Fit <− g p d F i t ( DC10 , u = min ( DC10 ) ) 20
DC20Fit <− g p d F i t ( DC20 , u = min ( DC20 ) ) 21
DC40Fit <− g p d F i t ( DC40 , u = min ( DC40 ) ) 22
DC60Fit <− g p d F i t ( DC60 , u = min ( DC60 ) ) 23
DC120Fit <− g p d F i t ( DC120 , u = min ( DC40 ) ) 24
As a means of data preprocessing, the exceedances can be declustered. In other words, only the maximum is recovered within a cluster of exceedances as the repre- sentative extreme loss. Hence, the declustered exceedances are at least the assumed width of the cluster apart from each other with respect to time. The aim of this data preprocessing technique is to ensure the validity of the GPD assumptions. Note that the results are sensitive to the choice of number of runs. To highlight this issue, declustered series have been retrieved for various periodicities in Listing 7.4. That is, the point process data have been declustered for weekly, biweekly, monthly, bi- monthly, and quarterly as well as half-yearly runs. Next, the GPD is fitted to these series and the results are provided in Table 7.5.
k k
Losses
1970−01−01 1990−01−01
515
0 5 10 15 20 25
0.00.40.8
ACF
0 5 10 15 20
0246
0 5 10 15 20 25
−0.100.100.25
Partial ACF
Figure 7.10 Plots for clustering of NYSE exceedances.
Table 7.5 Results for declustered GPD models.
Decluster ̂𝜉 ̂𝛽 Exceedances NLLH
Weekly 0.252 0.536 303 189.9
[0.066] [0.046]
Bi-weekly 0.324 0.518 222 147.5
[0.084] [0.055]
Monthly 0.33 0.59 149 118.76
[0.102] [0.076]
Bi-monthly 0.376 0.752 86 92.67
[0.146] [0.133]
Quarterly 0.421 0.824 61 73.59
[0.181] [0.178]
Semi-annually 0.581 0.928 25 37.66
[0.342] [0.352]
In this table the estimates for𝜉and𝛽are reported. The estimated standard errors are reported in square brackets. In the two columns to the right the numbers of declus- tered exceedances and the values of the negative log-likelihood are provided. The estimates for the shape parameter increase with run frequency (as one moves down the table), given that each run frequency is a valid choice. However, these point esti- mates become less reliable due to the decreased number of observations available for minimizing the negative log-likelihood, though the values for the latter do pick up for longer run periods. With respect to the derivation of VaR and/or ES these results imply quite different assessments of the riskiness inherent in the NYSE index. In particular, the point processes for the monthly, bimonthly, quarterly, and half-yearly declustered series do not indicate that their time gaps depart to a large extent from the exponential distribution, but the inference drawn from the fitted models does differ markedly.
k k
References
Beirlant J., Goegebeur Y., Segers J., and Teugels J. 2004Statistics of Extremes: Theory and Applications. John Wiley & Sons, Chichester, England.
Burger M., Jỹnemann K., and Kửnig T. 2015RUnit: R Unit Test Framework. R package version 0.4.28.
Coles S. 2001An Introduction to Statistical Modeling of Extreme Values. Springer Verlag, London, New York.
Deville Y. 2015aRenext: Renewal Method for Extreme Values Extrapolation. R package ver- sion 3.0-0.
Deville Y. 2015bRenextGUI: GUI for Renext. R package version 1.3-0.
Embrechts P., Klüppelberg C., and Miksoch T. 1997 Modelling Extremal Events for In- surance and Financevol. 33 ofStochastic Modelling and Applied Probability1st edn.
Springer-Verlag, Berlin.
Embrechts P., Puccetti G., and Rüschendorf L. 2013 Model uncertainty and VaR aggregation.
Journal of Banking and Finance38(8), 2750–2764.
Ferro C. and Segers J. 2003 Inference for clusters of extreme values.Journal of the Royal Statistical Society, Series B65(2), 545–556.
Gilleland E. and Katz R. 2011 New software to analyze how extremes change over time.Eos 92(2), 13–14.
Heffernan E. and Stephenson A. 2016ismev: An Introduction to Statistical Modeling of Ex- treme Values. R package version 1.41.
Leadbetter M., Lindgren G., and Rootzén, H. 1983Extremes and Related Properties of Random Sequences and Series. Springer-Verlag, New York.
McNeil A. 1999 Extreme value theory for risk managersInternal Modelling and CAD IIRISK Books pp. 93–113.
McNeil A., Frey R., and Embrechts P. 2005Quantitative Risk Management: Concepts, Tech- niques and Tools. Princeton University Press, Princeton, NJ.
Pfaff B. and McNeil A. 2012evir: Extreme Values in R. R package version 1.7-3.
Plummer M., Best N., Cowles K., and Vines K. 2006 CODA: Convergence diagnosis and output analysis for MCMC.R News6(1), 7–11.
Stephenson A. 2002 evd: Extreme value distributions.R News2(2), 0.
Stephenson A. and Ribatet M. 2006A User’s Guide to the evdbayes Package (Version 1.1).
Stephenson A. and Ribatet M. 2014evdbayes: Bayesian Analysis in Extreme Value Theory. R package version 1.1-1.
Würtz D. 2013fExtremes: Rmetrics – Extreme Financial Market Data. R package version 3010.81.
Würtz D., Setz T., and Chalabi Y. 2014fBasics: Rmetrics – Markets and Basic Statistics. R package version 3011.87.
k k
8
Modelling volatility