Package 'evt0'

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

Help Index


Mean of Order P, Peaks over Random Threshold Hill and High Quantile Estimates

Description

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.

Author(s)

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]


Duration based peaks over threshold value-at-risk forecast

Description

This function calculate the value-at-risk (VaR) forecast for the durations-based peaks over threshold (DPOT) models.

Usage

DPOT(x, cov=0.01, c=0.75, th=0.1,  nd=1000)

Arguments

x

Data vector.

cov

Coverage value, default is cov=0.01.

c

Tuning parameter, default is c=0.75.

th

Threshold value, default is th=0.1.

nd

Returns days, default is nd=1000.

Details

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).

Value

VaR forecast and also MLE estimates of shape and time scale parameters.

Warning

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.

Author(s)

P. Araujo Santos [email protected], M.I. Fraga Alves [email protected]

References

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.

Examples

#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)

Mean of order p statistic for the extreme value index

Description

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.

Usage

mop(x, k, p, method = c("MOP", "RBMOP"))

Arguments

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").

Details

Basic statistics for the EVI estimation, the MOP of UikU_{ik}, where Uik=Xni+1:nXnk:nU_{ik}= \frac{X_{n-i+1:n}}{X_{n-k:n}} and Xi:nX_{i:n} are order statistics, is

A(k)=(1ki=1kUikp)1/p,A(k)= ( \frac{1}{k} \sum^k_{i=1} U^p_{ik} )^{1/p},

for p0.p \neq 0.

The new class of MOP EVI- estimators is

Hp(k)=(1Ap(k))/p,H_p(k)= (1 - A^{-p}(k))/p,

for p0.p \neq 0. At p=0 the above MOP estimator is equal to classical Hill estimator.

Reduced bias MOP EVI-estimators is

RBA(k)=Hp(k)(1β(1pHp(k))1ρpHp(k)(nk)ρ).RBA(k)=H_p(k) (1- \frac{\beta (1-p H_p(k) )}{1-\rho-p H_p(k)} (\frac{n}{k})^\rho ).

Value

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.

Author(s)

B G Manjunath [email protected], Frederico Caeiro [email protected]

References

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.

Examples

# 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")

Asymptotic efficiency of mean of order p

Description

This function compute asymptotic relative efficiency of mean of order p (MOP) with respect to classical Hill estimator.

Usage

mop.AREFF(x, k, p)

Arguments

x

Data vector.

k

a vector of number of upper order statistics.

p

a vector of mean order.

Details

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.

Value

a matrix of asymptotic relative efficiency estimates, corresponds to k row and p columns.

Author(s)

B G Manjunath [email protected]

References

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.

See Also

mop

Examples

# 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))

High qunatile estimate by mean of order p statistic

Description

This function compute estimate of high quantile or value-at-risk (VAR) using mean of order p (MOP) method.

Usage

mop.q(x, k, p, q, method = c("MOP", "RBMOP"))

Arguments

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").

Details

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

Q(k)=(Xnk:n)(k/nq)Hp(k),Q(k) = (X_{n-k:n}) (k/nq)^{H_p(k)},

where Hp(k)H_p(k) is MOP EVI estimator and Xi:nX_{i:n} is order statistic.

Value

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.

Author(s)

B G Manjunath [email protected]

References

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.

See Also

mop

Examples

# 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")

Other extreme value index estimates

Description

This function computes moment (MO), generalized Hill (GH) and mixed moment (MM) estimates for extreme value index (EVI).

Usage

other.EVI(x, k, method = c("MO", "GH", "MM"))

Arguments

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").

Details

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.

Value

a k dimensional vector of EVI estimates.

Author(s)

B G Manjunath [email protected], Frederico Caeiro [email protected]

References

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.

Examples

# generate random samples               
x = rfrechet(50000, loc = 0, scale = 1,shape = 1/0.5)

# estimate EVI 
other.EVI(x,c(500,5000,40000),"MO")

Other methods for high quantile estimate

Description

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.

Usage

other.q(x, k, q, method = c("MO", "GH", "MM"))

Arguments

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").

Details

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).

Value

a k dimensional vector of EVI and high quantile estimates.

Author(s)

B G Manjunath [email protected]

References

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.

See Also

other.EVI

Examples

# 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")

Other peaks over random threshold high quantile estimate

Description

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.

Usage

otherPORT.q(x, k, q1, q2, method = c("MO", "GH", "MM"))

Arguments

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").

Details

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).

Value

a k dimensional vector of PORT EVI and high quantil estimates.

Author(s)

B G Manjunath [email protected]

References

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.

See Also

other.EVI

Examples

# 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")

Peaks over random threshold Hill estimate

Description

This function performs peaks over random threshold (PORT) Hill methodology for estimating extreme value index (EVI) for heavy tailed models.

Usage

PORT.Hill(x, k, q, method = c("PMOP", "PRBMOP"))

Arguments

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").

Details

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.

Value

a k dimensional vector of PORT Hill estimates. When Method = "RBMOP" shape and scale second order parameters estimates are also returned.

Author(s)

B G Manjunath [email protected], Frederico Caeiro [email protected]

References

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.

Examples

# 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")

Peaks over random threshold high quantile estimate

Description

This function computes high quantile or value-at-risk (VaR) estimate based on peaks over random threshold (PORT) Hill extreme value index (EVI) estimate.

Usage

PORT.q(x, k, q1, q2, method = c("PMOP", "PRBMOP"))

Arguments

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").

Details

The computation of the high quantile estimate is based on the work by Gomes et al. (2006).

Value

a k dimensional vector of PORT Hill and high quantile estimates. When Method = "RBMOP" shape and scale second order parameters estimates are also returned.

Author(s)

B G Manjunath [email protected]

References

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.

See Also

PORT.Hill

Examples

# 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")

S&P500

Description

Log-returns of S&P500 Index from 05-01-1960 untill 16-10-1987.

Usage

data(S_P500)

Format

A data frame with 6984 observations on the following variable.

returns

a numeric vector

Details

Log-returns of S&P500 Index from 05-01-1960 untill 16-10-1987.

Examples

data(S_P500)
str(S_P500)
plot(S_P500$returns)