We analyze the daily returns of the exchange rate of the Yen related to the U.S. Dollar from Dec. 1, 1978 to Jan. 31, 1991. Our aim is to fit a generalized Pareto model to the lower tail of the returns to estimate the probability of extreme losses. We start the analysis by loading the finance library and the data set dyr.dat :
library("finance") dyr=read("dyr.dat")A scatter plot of the data set can be obtained using the command
plot(1:rows(dyr)~dyr)In the Academic Version of XploRe the following examples can be executed with the smaller data set dyr1000.dat . Although slightly different results are obtained, one can still recognize that the Hill estimator is unsuited for that data set.
![]() |
One recognizes from Figure 13.3 that the distribution of the returns possesses a fat tail. Because our estimators are defined for the upper tail, one must change the sign of the data set with the command
dyr = -dyrA suitable threshold can be selected by plotting an estimator diagram. The call
r=momentgpdiag(dyr,5:500) plot(5:500~r)produces the diagram in Figure 13.4. We select
This task is performed by the following code (calls to format the graphical output are not shown):
m=momentgp(dyr,160) d=createdisplay(1,1) t=aseq(0.965,350,0.0001) qf=t~m.mu+m.sigma*qfx("gp",t,m.gamma) show(d,1,1,qf) empqf=(4284:4444)/4445~sort(dyr)[4284:4444] adddata(d,1,1,empqf)
The Hill estimator yields a similar picture (execute the following lines to add the pertaining Pareto quantile function to the plot).
h=hillgp1(dyr,160) hqf=t~h.sigma*qfx("gp1",t,h.alpha) adddata(d,1,1,hqf)
h=hillgp1(dyr,160) m=momentgp(dyr,160) d=createdisplay(1,1) t=aseq(0.009,210,0.0001) ; ; plot empirical mean excess function ; et=sort(dyr)[rows(dyr)-160:rows(dyr)-1] eme=et~empme(dyr,et) show(d,1,1,eme) ; hme=t~gp1me(h.alpha,t/h.sigma)*h.sigma adddata(d,1,1,hme) ; mme=t~gpme(m.gamma,(t-m.mu)/m.sigma)*m.sigma adddata(d,1,1,mme)
![]() |
One can recognize that the empirical mean excess function is close to a straight line, which justifies the GP modeling. Yet, the GP mean excess function, based on the Hill estimator, strongly deviates from the empirical mean excess function. This indicates that the Hill estimator is not applicable.