xindexfield <- function(y,u,threshold = FALSE) { # Description: # # Computes the intervals estimator for the extremal index, an index for # time clusters, at each grid point of a three-dimensional array of data # with first two space dimensions (e.g. longitude and latitude) and # third time dimension # # Usage: # # xindexfield(y,u,threshold=FALSE) # # Arguments: # # y: a three-dimensional array, with first two space dimensions (e.g. # longitude and latitude) and third time dimension # # u: Threshold. Can be either a quantile (e.g. 0.8) or a threshold value # (see definition of theshold below). # # threshold: Logical. If FALSE (the default) u must be a quantile value. # If TRUE, then u must be a threshold value. # # Value: # # Estimate of the extremal index at each grid point. # # Details: # # Warning: # # The estimator is not constrained to lie in [0,1] and a # default value of 1 is returned if there are fewer than two # extreme values. # # Authors: # # Christopher Ferro 3 Jan 2006 # Caio Coelho # # References: # # Ferro CAT & Segers J (2003) Inference for clusters of extreme # values. Journal of the Royal Statistical Society B 65, 545-556. # # Examples: # # x <- seq(-20, 20, 5) # y <- seq(30, 60, 5) # dim <- c(length(x), length(y), 100) # data <- array(rnorm(prod(dim),25,2), dim) # xindexfield(data,0.9) # xindexfield(data,28,threshold=TRUE) apply(y,c(1,2),xindex,u,threshold) }