decluster: A declustering scheme for dependent exceedances

Description Usage Arguments Details Value Examples

View source: R/decluster.R

Description

Calculate clusters of exceedances for a sequence of dependent random variables

Usage

1
decluster(x, index, uq = 0.9, r = 0, u, doplot = TRUE, ...)

Arguments

x

Numeric, sequence of depedent random variables.

index

Numeric, vector specifying the index for the elements of x.

uq

Numeric in (0, 1), calculates the threshold as quantile(x, uq).

r

Numeric, nonnegative integer, the decluster parameter.

u

Numeric, if specified, the threshold is u and overrides what is chosen for uq.

doplot

Logical, should a plot be generated?

...

Additional arguments passed to the plot that is generated if doplot = TRUE.

Details

The argument index may be used to specify when each observation in x has occurred. For example, suppose x contains daily observations in January on two separate years, making length(x) = 62. Leaving index blank would treat January 31 of year one as the day just before January 1 of year two, allowing the possibility of clusters to exist that span both year. In this example, index should be c(1:31, 366:396).

The decluster parameter r controls the cluster sizes. Two exceedances are part of different clusters if there are at least r non-exceedances between the two obsverations. This has the consequence that for r = 0, every observation will be its own cluster.

When multiple observations are part of the same cluster, the maximum value in that cluster is the value that is return.

If doplot = TRUE (the default), then a plot of (index, x) is shown with a horizontal line at the threshold, and clusters are marked by the shape and color. (Note: the color/shape pattern of clusters is repeated every 77 clusters).

Value

The maximum _excess_ for each cluster, the number of clusters, the number of exceedances, the number of observations, the threshold used, the decluster parameter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1)
x = rnorm(100)
decluster(x, uq = 0.5, r=0) # 50 clusters
decluster(x, uq = 0.5, r=1) # 26 clusters
decluster(x, uq = 0.5, r=2) # 12 clusters
decluster(x, uq = 0.5, r=3) # 4 clusters
decluster(x, uq = 0.5, r=4) # 4 clusters
decluster(x, uq = 0.5, r=5) # 3 clusters
decluster(x, uq = 0.5, r=6) # 2 clusters
decluster(x, uq = 0.5, r=7) # 1 cluster

mickwar/mwEVT documentation built on May 22, 2019, 9:56 p.m.