taildep.test: Tail Dependence Test

View source: R/dependence.R

taildep.testR Documentation

Tail Dependence Test

Description

Testing tail dependence against tail independence.

Usage

taildep.test(x, y, cthresh = -0.5, trans = "relative.rank", na.action = na.fail, ...)

relative.rank(x, div = "n", ...)

Arguments

x, y

numeric vectors of same length. For taildep.test, x may be a two-column matrix or data frame, in which case each column is assumed to be the two vectors of interest.

cthresh

single numeric between -1 and 0 (non-inclusive) over which the transformed and shifted x + y variable is tested (see Details).

trans

character string naming a function to transform the x and y variables so that they are in the lower left quadrant (see Details). If variables are already transformed as such (or it is not necessary), then use “identity”.

div

character one of “n” or “n+1” stating whether to divide the ranks by n or n + 1 so that the reslting transformations are in [0,1] or (0,1), resp.

na.action

function to be called to handle missing values.

...

optional arguments to the trans function. In the case of relative.rank these are optional arguments to the function rank.

Details

This is the tail dependence test described in Reiss and Thomas (2007) section 13.3. It is, unusually, a test whose null hypothesis is that the two random variables, X and Y, are dependent. So, for example, if a significance level alpha = 0.01 test is desired, then the null huypothesis (dependence) is rejected for values of the statistic with p-values less than 0.01.

To do the test, the variables must first be transformed to the left lower quadrant. Following Reiss and Thomas (2007), the default is to transform the data by means of the sample distribution functions (df's), u = Fhat_n(x) and v = Fhat_n(y) (i.e., using the function relative.rank). This yields random variables between 0 and 1, and subsequently they are shifted to be between -1 and 0 (this is done by taildep.test so should not be done by the trans function).

Ultimately, the test statistic is given by

-(sum(log(c.tilde) + m)/sqrt(m)),

where c.tilde = (u + v)*1(u+v > c)/c, for c a threshold (i.e., cthresh). The statistic is assumed to be N(0,1), and the p-value is calculated accordingly.

The test is somewhat sensitive to the choice of threshold, cthresh, and it is probably a good idea to try several values (approaching zero from the left). Ideally, the threshold should yield about 10 - 15 percent excesses.

Value

A list object of class “htest” is returned with components:

call

the calling string

data.name

character vector giving the names of the data sets employed (if x is a matrix, then the second component will be “ ”.

method

character string, which will always be “Reiss-Thomas (13.35)”.

transformation

same as trans argument.

parameter

named vector giving the value of the threshold and any arguments passed to the trans function (perhaps this is not a good idea, and may be changed eventually).

c.full

value of the vector u + v after having been transformed and shifted to be between -1 and 0. This is so that the user can adjust the threshold so that 10 - 15 percent of the values exceed it.

statistic

numeric giving the value of the test statistic.

alternative

character string stating “greater”.

p.value

numeric between 0 and 1 giving the p-value for the test.

Author(s)

Eric Gilleland

References

Reiss, R.-D. and Thomas, M. (2007) Statistical Analysis of Extreme Values: with applications to insurance, finance, hydrology and other fields. Birkhauser, 530pp., 3rd edition.

See Also

taildep, atdf, lr.test

Examples

x <- arima.sim(n = 63, list(ar = c(0.8897, -0.4858), ma = c(-0.2279, 0.2488)),
               sd = sqrt(0.1796))

y <- x + rnorm(63)

taildep.test(x, y)

# Recall that null hypothesis is tail dependence!

## Not run: 
data(PORTw)
taildep.test(PORTw$TMX1, PORTw$TMN0, cthresh=-0.3)

data(FCwx)
taildep.test(FCwx$MxT, FCwx$Prec, cthresh=-0.4)

# Run the example (13.3.6) in Reiss and Thomas (2007)
# using the 'wavesurge' dataset from package 'ismev'.
data(wavesurge)
cth <- seq(-0.46,-0.35,0.01)
tab13.1 <- matrix(NA, 2, 12)
colnames(tab13.1) <- as.character(cth)
for(i in 1:12) {
    tmp <- taildep.test(wavesurge, cthresh=cth[i], ties.method="max")
    tab13.1[1,i] <- tmp$parameter["m"]
    tab13.1[2,i] <- tmp$p.value
} # end of for 'i' loop.

rownames(tab13.1) <- c("m", "p-value")
tab13.1

## End(Not run)


extRemes documentation built on May 29, 2024, 5:27 a.m.