threshold: Apply a threshold to a time series

View source: R/extremes.R

thresholdR Documentation

Apply a threshold to a time series

Description

Extracts all data above a certain threshold of a xts class object or a list of those.

Usage

threshold(x, threshold, decluster = TRUE, cluster.distance = NULL,
  extreme.type = c("max", "min"), na.rm = TRUE, mc.cores = TRUE)

Arguments

x

Either an object of class xts or a list of those.

threshold

Numerical value, which has to be exceeded by the data.

decluster

Logical flag indicating whether or not to decluster the obtained exceedances over the threshold. Default = TRUE.

cluster.distance

Numerical value specifying how many points have to be below the threshold for the next point to be considered the starting point of a new cluster. Only supply a value when you really know what you are doing! Default = NULL.

extreme.type

String specifying whether the events below a very low ("min") or above a very high ("max") threshold should be extracted. The threshold will be subtracted from the data in both cases. Default: "max".

na.rm

Logical flag indicating whether to remove all NA values from the time series (removed points in clusters). For important steps, like calculating the Lmoments of a time series, there must not be any NA left. Default = TRUE.

mc.cores

A numerical input specifying the number of cores to use for the multi core application of the function (see detectCores). This functionality is only available if the input is a list of different objects. If NULL, the function will be calculated classically with only one core. Default = NULL.

Details

After extracting all data above the threshold, the threshold argument itself is going to be subtracted from the data.

In addition, all exceedance can be declustered. This step is highly recommendes, since the extreme value theory is only valid for data without correlations (which are present in most measured data). Using this method, at least the short-range correlations in the data can be taken care of.

Value

Same class as the input

Author(s)

Philipp Mueller

See Also

Other extremes: block.list, block.xts, block, decluster.list, decluster.xts, decluster, extremal.index, gev.density, gpd.density, qevd, return.level.climex.fit.gev, return.level.climex.fit.gpd, return.level.list, return.level.numeric, return.level, revd, rlevd, threshold.list, threshold.xts, upper.limit.climex.fit.gev, upper.limit.climex.fit.gpd, upper.limit.list, upper.limit.numeric, upper.limit


theGreatWhiteShark/climex documentation built on July 13, 2022, 9:11 a.m.