Title: | Mean of Order P, Peaks over Random Threshold Hill and High Quantile Estimates |
---|---|
Description: | The R package proposes extreme value index estimators for heavy tailed models by mean of order p <DOI:10.1016/j.csda.2012.07.019>, peaks over random threshold <DOI:10.57805/revstat.v4i3.37> and a bias-reduced estimator <DOI:10.1080/00949655.2010.547196>. The package also computes moment, generalised Hill <DOI:10.2307/3318416> and mixed moment estimates for the extreme value index. High quantiles and value at risk estimators based on these estimators are implemented. |
Authors: | Leo Belzile [cre] , B. G. Manjunath [aut] , Frederico Caeiro [aut] , Maria Ivette. Gomes [ctb] , Maria Isabel Fraga Alves [ctb] |
Maintainer: | Leo Belzile <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1-4 |
Built: | 2024-10-29 02:44:36 UTC |
Source: | https://github.com/lbelzile/evt0 |
Computes extreme value index (EVI) estimate for heavy tailed models by mean of order p (MOP) and peaks over random threshold (PORT) Hill methodologies. Besides, also computes moment, generalised Hill and mixed moment estimates for EVI. Compute high quantile or value-at-risk (VaR) based on above EVI estimates.
B G Manjunath [email protected] and Frederico Caeiro [email protected]; guidance from Prof. M. Ivette Gomes [email protected] and Prof. M. Isabel Fraga Alves [email protected]
This function calculate the value-at-risk (VaR) forecast for the durations-based peaks over threshold (DPOT) models.
DPOT(x, cov=0.01, c=0.75, th=0.1, nd=1000)
DPOT(x, cov=0.01, c=0.75, th=0.1, nd=1000)
x |
Data vector. |
cov |
Coverage value, default is |
c |
Tuning parameter, default is |
th |
Threshold value, default is |
nd |
Returns days, default is |
In financial time series a relation between the excesses and the durations between excesses is usuallly observed. Araujo Santos and Fraga Alves (2013) propose using this dependece to improve the risk forecasts with DPOT models. The computation method in DPOT()
function is based on the work from Araujo Santos and Fraga Alves (2012).
VaR forecast and also MLE estimates of shape and time scale parameters.
After running the function following message appears:
In log(1+gamma*y/(alpha1*(1/x)^c )): NaNs produced
when the gamma is negative but the optimizer continue to other iternations choosing other values until it converge.
P. Araujo Santos [email protected], M.I. Fraga Alves [email protected]
Araujo Santos, P. and Fraga Alves, M.I. (2013). Forecasting Value-at-Risk with a duration-based POT method. Mathematics and Computers in Simulation, 94, 295–309.
Araujo Santos, P. and Fraga Alves, M.I. (2012). R Program to Implement the DPOT Model. Unpublished article.
#Read S&P500 from data file data(S_P500) str(S_P500) # One day ahead VaR forecast DPOT(S_P500$returns,0.01,0.75,0.1,1000)
#Read S&P500 from data file data(S_P500) str(S_P500) # One day ahead VaR forecast DPOT(S_P500$returns,0.01,0.75,0.1,1000)
This function compute mean of order p (MOP) basic statistic for the extreme value index (EVI), which is indeed a simple generalisation of the Hill estimator.
mop(x, k, p, method = c("MOP", "RBMOP"))
mop(x, k, p, method = c("MOP", "RBMOP"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
p |
a vector of mean order. |
method |
Method used, ("MOP", default) and reduced-bias MOP ("RBMOP"). |
Basic statistics for the EVI estimation, the MOP of , where
and
are order statistics, is
for
The new class of MOP EVI- estimators is
for
At
p=0
the above MOP estimator is equal to classical Hill estimator.
Reduced bias MOP EVI-estimators is
a matrix of EVI estimates, corresponds to k
row and p
columns. When Method = "RBMOP"
shape and scale second order parameters estimates are also returned.
B G Manjunath [email protected], Frederico Caeiro [email protected]
Brilhante, M.F., Gomes, M.I. and Pestana, D. (2013). A simple generalisation of the Hill estimator. Computational Statistics and Data Analysis, 57, 518– 535.
Beran, J., Schell, D. and Stehlik, M. (2013). The harmonic moment tail index estimator: asymptotic distribution and robustness. Ann Inst Stat Math, Published Online.
Gomes, M.I., Brilhante, M.F. and Pestana, D. (2013). New reduced-bias estimators of a positive extreme value index. Submitted article.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI mop(x,c(1,500,5000,49999), c(-1,0,1),"RBMOP")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI mop(x,c(1,500,5000,49999), c(-1,0,1),"RBMOP")
This function compute asymptotic relative efficiency of mean of order p (MOP) with respect to classical Hill estimator.
mop.AREFF(x, k, p)
mop.AREFF(x, k, p)
x |
Data vector. |
k |
a vector of number of upper order statistics. |
p |
a vector of mean order. |
Given two biased estimators MOP and Hill, the asymptotic root efficiency (AREFF) of MOP relatively to Hill is given in Brilhante et al. (2013). Note that highest the AREFF indicator the better is the MOP estimator.
a matrix of asymptotic relative efficiency estimates, corresponds to k
row and p
columns.
B G Manjunath [email protected]
Brilhante, M.F., Gomes, M.I. and Pestana, D. (2013). A simple generalisation of the Hill estimator. Computational Statistics and Data Analysis, 57, 518– 535.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1) # estimate AREFF mop.AREFF(x,c(1,500,5000,49999), c(-1,0,0.1))
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1) # estimate AREFF mop.AREFF(x,c(1,500,5000,49999), c(-1,0,0.1))
This function compute estimate of high quantile or value-at-risk (VAR) using mean of order p (MOP) method.
mop.q(x, k, p, q, method = c("MOP", "RBMOP"))
mop.q(x, k, p, q, method = c("MOP", "RBMOP"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
p |
a vector of mean order. |
q |
quantile level. |
method |
Method used, ("MOP", default) and reduced-bias MOP ("RBMOP"). |
For heavy tails, Gomes et al. (2013) introduces a new class of high quantile estimators based on a class of mean of order p (MOP) extreme value index (EVI) estimators is givin by
where is MOP EVI estimator and
is order statistic.
a matrix of EVI and VaR estimates, corresponds to k
row and p
columns. When Method = "RBMOP"
shape and scale second order parameters estimates are also returned.
B G Manjunath [email protected]
Brilhante, M.F., Gomes, M.I. and Pestana, D. (2013). A simple generalisation of the Hill estimator. Computational Statistics and Data Analysis, 57, 518– 535.
Beran, J., Schell, D. and Stehlik, M. (2013). The harmonic moment tail index estimator: asymptotic distribution and robustness. Ann Inst Stat Math, Published Online.
Gomes, M.I., Brilhante, M.F. and Pestana, D. (2013). New reduced-bias estimators of a positive extreme value index. Submitted article.
Weissman, I. (1978). Estimation of parameters and large quantiles based on the k largest observations. J. Amer. Statist. Assoc., 73, 812– 815.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI and high quantile at level q mop.q(x,c(1,500,5000,49999), c(-1,0,1),0.5,"RBMOP")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI and high quantile at level q mop.q(x,c(1,500,5000,49999), c(-1,0,1),0.5,"RBMOP")
This function computes moment (MO), generalized Hill (GH) and mixed moment (MM) estimates for extreme value index (EVI).
other.EVI(x, k, method = c("MO", "GH", "MM"))
other.EVI(x, k, method = c("MO", "GH", "MM"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
method |
Method used, moment estimate("MO", default), generalized Hill ("GH") and mixed moment ("MM"). |
Computation of moment and generalized Hill and mixed moment EVI estimators are based on the articles by Dekkers et al. (1989), Beirlant et al. (1996) and Fraga Alves et al. (2009), respectively.
a k
dimensional vector of EVI estimates.
B G Manjunath [email protected], Frederico Caeiro [email protected]
Dekkers, A., Einmahl, J. and L. de Haan. (1989). A moment estimator for the index of an extreme-value distribution. Ann. Statist., 17, 1833– 1855.
Beirlant, J., Vynckier, P. and Teugels, J. (1996). Excess functions and estimation of the extreme-value index. Bernoulli, 2, 293–318.
Fraga Alves, M.I., Gomes, M.I., de Haan, L. and Neves, C. (2009). The mixed moment estimator and location invariant alternatives. Extremes, 12, 149–185.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI other.EVI(x,c(500,5000,40000),"MO")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI other.EVI(x,c(500,5000,40000),"MO")
This function computes high quantile or value-at-risk (VaR) estimate based on moment (MO), generalized Hill (GH) and mixed moment (MM) extreme value index (EVI) estimates.
other.q(x, k, q, method = c("MO", "GH", "MM"))
other.q(x, k, q, method = c("MO", "GH", "MM"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
q |
quantile level. |
method |
Method used, moment estimate("MO", default), generalized Hill ("GH") and mixed moment ("MM"). |
The computation of estimate of high quantile or VaR is based on moment, generalized Hill and mixed moment EVI estimators and the computation of EVI estimators are related to the work by Dekkers et al. (1989), Beirlant et al. (1996) and Fraga Alves et al. (2009).
a k
dimensional vector of EVI and high quantile estimates.
B G Manjunath [email protected]
Dekkers, A., Einmahl, J. and L. de Haan. (1989). A moment estimator for the index of an extreme-value distribution. Ann. Statist., 17, 1833– 1855.
Beirlant, J., Vynckier, P. and Teugels, J. (1996). Excess functions and estimation of the extreme-value index. Bernoulli, 2, 293–318.
Fraga Alves, M.I., Gomes, M.I., de Haan, L. and Neves, C. (2009). The mixed moment estimator and location invariant alternatives. Extremes, 12, 149–185.
Weissman, I. (1978). Estimation of parameters and large quantiles based on the k largest observations. J. Amer. Statist. Assoc., 73, 812– 815.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI and high quantile at level q other.q(x,c(500,5000,40000),0.5,"MO")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate EVI and high quantile at level q other.q(x,c(500,5000,40000),0.5,"MO")
This function computes peaks over random threshold (PORT) high quantile or value-at-risk (VaR) based on moment (MO), generalized Hill (GH) and mixed moment (MM) extreme value index (EVI) estimates.
otherPORT.q(x, k, q1, q2, method = c("MO", "GH", "MM"))
otherPORT.q(x, k, q1, q2, method = c("MO", "GH", "MM"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
q1 |
quantile for PORT. |
q2 |
quantile level. |
method |
Method used, moment estimate("MO", default), generalized Hill ("GH") and mixed moment ("MM"). |
The computation of high quantile estimate is based on the method by Weissman (1978) and the EVI estimators are given in Dekkers et al. (1989), Beirlant et al. (1996) and Fraga Alves et al. (2009).
a k
dimensional vector of PORT EVI and high quantil estimates.
B G Manjunath [email protected]
Araujo Santos, P., Fraga Alves, M.I. and Gomes, M.I. (2006). Peaks over random threshold methodology for tail index and quantile estimation. Revstat, 4(3), 227–247.
Dekkers, A., Einmahl, J. and L. de Haan. (1989). A moment estimator for the index of an extreme-value distribution. Ann. Statist., 17, 1833– 1855.
Beirlant, J., Vynckier, P. and Teugels, J. (1996). Excess functions and estimation of the extreme-value index. Bernoulli, 2, 293–318.
Fraga Alves, M.I., Gomes, M.I., de Haan, L. and Neves, C. (2009). The mixed moment estimator and location invariant alternatives. Extremes, 12, 149–185.
Weissman, I. (1978). Estimation of parameters and large quantiles based on the k largest observations. J. Amer. Statist. Assoc., 73, 812– 815.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate PORT EVI and high quantile at level q2 otherPORT.q(x,c(500,5000),0.1,0.5,"MO")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate PORT EVI and high quantile at level q2 otherPORT.q(x,c(500,5000),0.1,0.5,"MO")
This function performs peaks over random threshold (PORT) Hill methodology for estimating extreme value index (EVI) for heavy tailed models.
PORT.Hill(x, k, q, method = c("PMOP", "PRBMOP"))
PORT.Hill(x, k, q, method = c("PMOP", "PRBMOP"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
q |
quantile for PORT. |
method |
Method used, ("PMOP", default) and reduced-bias PMOP ("PRBMOP"). |
The computation of PORT Hill estimator is based on the work by Araujo Santos et al. (2006). Reduced biased PORT Hill computation is based on quasi-PORT methodology, see Gomes et al.
a k
dimensional vector of PORT Hill estimates. When Method = "RBMOP"
shape and scale second order parameters estimates are also returned.
B G Manjunath [email protected], Frederico Caeiro [email protected]
Araujo Santos, P., Fraga Alves, M.I. and Gomes, M.I. (2006). Peaks over random threshold methodology for tail index and quantile estimation. Revstat, 4(3), 227–247.
Gomes, M.I., Figueiredo, F., Henriques-Rodrigues, L. and Miranda, M.C. (2006). A quasi-PORT methodology for VaR based on second-order reduced-bias estimation.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate PORT Hill PORT.Hill(x,c(1,500,5000),0.1,"PRBMOP")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate PORT Hill PORT.Hill(x,c(1,500,5000),0.1,"PRBMOP")
This function computes high quantile or value-at-risk (VaR) estimate based on peaks over random threshold (PORT) Hill extreme value index (EVI) estimate.
PORT.q(x, k, q1, q2, method = c("PMOP", "PRBMOP"))
PORT.q(x, k, q1, q2, method = c("PMOP", "PRBMOP"))
x |
Data vector. |
k |
a vector of number of upper order statistics. |
q1 |
quantile for PORT. |
q2 |
quantile level. |
method |
Method used, ("PMOP", default) and reduced-bias PMOP ("PRBMOP"). |
The computation of the high quantile estimate is based on the work by Gomes et al. (2006).
a k
dimensional vector of PORT Hill and high quantile estimates. When Method = "RBMOP"
shape and scale second order parameters estimates are also returned.
B G Manjunath [email protected]
Araujo Santos, P., Fraga Alves, M.I. and Gomes, M.I. (2006). Peaks over random threshold methodology for tail index and quantile estimation. Revstat, 4(3), 227–247.
Gomes, M.I., Figueiredo, F., Henriques-Rodrigues, L. and Miranda, M.C. (2006). A quasi-PORT methodology for VaR based on second-order reduced-bias estimation.
Weissman, I. (1978). Estimation of parameters and large quantiles based on the k largest observations. J. Amer. Statist. Assoc., 73, 812– 815.
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate PORT Hill and quantile at level q2 PORT.q(x,c(1,500,5000),0.1,0.5,"PRBMOP")
# generate random samples x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5) # estimate PORT Hill and quantile at level q2 PORT.q(x,c(1,500,5000),0.1,0.5,"PRBMOP")
Log-returns of S&P500 Index from 05-01-1960 untill 16-10-1987.
data(S_P500)
data(S_P500)
A data frame with 6984 observations on the following variable.
returns
a numeric vector
Log-returns of S&P500 Index from 05-01-1960 untill 16-10-1987.
data(S_P500) str(S_P500) plot(S_P500$returns)
data(S_P500) str(S_P500) plot(S_P500$returns)