Learn R Programming

EXRQ (version 1.0)

ThreeStage: Three-Stage Extreme Conditional Quantile Estimator

Description

Provides the estimation of extreme conditional quantile using the three-stage estimation method in Wang and Li (2013). Specifically the function estimates the tau.e-th conditional quantile of Y given x=xstar based on the power-transformed quantile regression model and extreme value theory. The method is based on Hill estimator for the extreme value index and works for heavy-tailed distributions (on the original scale).

Usage

ThreeStage(y, x, xstar, tau.e, grid.lam = seq(-2, 2, 0.1), grid.k, tau.lam, a = 0, tol = 1e-04)

Arguments

y
a vector of n responses
x
a n x p matrix of n observations and p predictors
xstar
a m x p matrix of m observations and p predictors
tau.e
the extreme quantile level of interest
grid.lam
the set of lambda (transformation parameter) values for grid search
grid.k
the grid for the number of upper order statistics involved in Hill estimator; used for searching for the data-adaptive k. If the lenfth of grid.k is 1, then k is fixed at grid.k and no selection is performed.
tau.lam
the quantile level used for estimating the transformation parameter
a
location shift parameter in the power transformation (introduced to avoid negative y values)
tol
the tolerance level for checking quantile crossing issue

Value

A list is returned with the following componentslam: the estimated power-transformation parameterk: the selected k, the number of upper order statistics involved in Hill estimatorgamma.x: the estimated x-dependent extreme value index (EVI)cgmma: the pooled EVI estimationQ3Stage: the three-stage estimator of the tau.e-th conditional quantile of Y given xstar based on the x-dependent EVI estimationQ3StageP: the three-stage estimator of the tau.e-th conditional quantile of Y given xstar based on the pooled EVI estimation

References

Wang, H. and Li, D. (2013). Estimation of conditional high quantiles through power transformation. Journal of the American Statistical Association, 108, 1062-1074.

See Also

TwoStage

Examples

Run this code
#A simulation example (sqrt transformation, heteroscedastic error)
library(EXRQ)
n=500
tau.e = c(0.99, 0.993, 0.995)
set.seed(12368819)
x1 = runif(n, -1, 1)
x2 = runif(n, -1, 1)
sqrty = 2 + x1 + x2 + (1+0.8*x1)*rpareto(n, 0.5)
x = as.matrix(cbind(x1, x2))
y = sqrty^2
xstar = rbind(c(-0.5,0),c(0,-0.5),c(0,0),c(0.5,0),c(0,0.5))
## 3Stage estimator
out.3stage <- ThreeStage(y, x, xstar, tau.e, grid.lam=seq(-0.5, 1.5, 0.1), grid.k=50, tau.lam=0.9)

Run the code above in your browser using DataLab