Last data update: 2014.03.03

R: Wadsworth's univariate and bivariate exponential threshold...
W.diagR Documentation

Wadsworth's univariate and bivariate exponential threshold diagnostics

Description

Function to produce diagnostic plots and test statistics for the threshold diagnostics exploiting structure of maximum likelihood estimators based on the non-homogeneous Poisson process likelihood

Usage

W.diag(xdat, model = c("nhpp", "exp", "invexp"), u = NULL, k, q1 = 0,
  q2 = 1, par = NULL, M = NULL, nbs = 1000, alpha = 0.05,
  plots = c("LRT", "WN", "PS"), UseQuantiles = TRUE, pmar = c(5.5, 7, 3,
  3), tikz = FALSE, ...)

Arguments

xdat

a numeric vector of data to be fitted.

model

string specifying whether the univariate or bivariate diagnostic should be used. Either nhpp for the univariate model, exp (invexp) for the bivariate exponential model with rate (inverse rate) parametrization. See details.

u

optional; vector of candidate thresholds.

k

number of thresholds to consider (if u unspecified).

q1

lowest quantile for the threshold sequence.

q2

upper quantile limit for the threshold sequence (q2 itself is not used as a threshold, but rather the uppermost threshold will be at the q2-1/k quantile).

par

parameters of the NHPP likelihood. If missing, the fpot routine will be run to obtain values

M

number of superpositions or "blocks" / "years" the process corresponds to (can affect the optimization)

nbs

number of simulations used to assess the null distribution of the LRT, and produce the p-value

alpha

significance level of the LRT

plots

vector of strings indicating which plots to produce; LRT= likelihood ratio test, WN = white noise, PS = parameter stability

UseQuantiles

logical; use quantiles as the thresholds in the plot?

pmar

vector of length 4 giving the arguments for the plot margins in par(mar=c(*,*,*,*)).

tikz

logical; if TRUE, axis labels are replaced with LaTeX code

...

additional parameters passed to plot.

Details

The function is a wrapper for the univariate (non-homogeneous Poisson process model) and bivariate exponential dependence model. For the latter, the user can select either the rate or inverse rate parameter (the inverse rate parametrization works better for uniformity of the p-value distribution under the LR test.

There are two options for the bivariate diagnostic: either provide pairwise minimum of marginally exponentially distributed margins or provide a n times 2 matrix with the original data, which is transformed to exponential margins using the empirical distribution function.

Value

plots of the requested diagnostics and a list with components

  • MLE maximum likelihood estimates from all thresholds

  • Cov joint asymptotic covariance matrix for xi, eta or 1/eta.

  • WN values of the white noise process.

  • LRT values of the likelihood ratio test statistic vs threshold.

  • pval P-value of the likelihood ratio test.

  • k final number of thresholds used.

  • thresh threshold selected by the likelihood ratio procedure.

  • mle.u maximum likelihood estimates from selected threshold.

Author(s)

Jennifer L. Wadsworth

References

Wadsworth, J.L. (2016). Exploiting Structure of Maximum Likelihood Estimators for Extreme Value Threshold Selection, Technometrics, 58(1), 116-126, http://dx.doi.org/10.1080/00401706.2014.998345.

Examples

## Not run: 
set.seed(123)
W.diag(rexp(1000), model="nhpp", k=30, q1=0)
# Parameter Stability only
W.diag(abs(rnorm(5000)), model="nhpp", k=30, q1=0, plots=c("PS"))
library(mvtnorm)
xbvn<-rmvnorm(6000, sigma=matrix(c(1,0.7,0.7,1),2,2))
# Transform margins to exponential manually
xbvn.exp<- -log(1-pnorm(xbvn))
W.diag(apply(xbvn.exp,1,min), model="exp", k=30, q1=0) #rate parametrization
W.diag(xbvn, model="exp", k=30, q1=0)
W.diag(apply(xbvn.exp,1,min), model="invexp", k=30, q1=0) #inverse rate parametrization

## End(Not run)
## Not run: 
library(ismev)
data(rain)
u <- quantile(rain, seq(0.85,0.99,by=0.01))
W.diag(xdat=rain, u=u, plots="PS")

## End(Not run)

Results