Learn R Programming

fExtremes (version 201.10060)

ExtremesPreprocessing: Preprocessing Extreme Value Data

Description

A collection and description of functions for preprocessing data for extreme value analysis. Included are tools to separate data beyond a threshold value, to compute blockwise data like block maxima, and to decluster point process data. The functions are: ll{ findThreshold Upper threshold for a given number of extremes, blocks Create data blocks on vectors and time series, blockMaxima Block Maxima from a vector or a time series, deCluster Declusters clustered point process data. }

Usage

findThreshold(x, n = NA)
blocks(x, block = "month", FUN = max)
blockMaxima(x, block = "month", details = FALSE, doplot = TRUE, ...)
deCluster(x, run = NA, doplot = TRUE)

Arguments

block
the block size. A numeric value is interpreted as the number of data values in each successive block. All the data is used, so the last block may not contain block observations. If the data has a
details
[blockMaxima] - a logical. Should details be printed?
doplot
a logical. Should the results be plotted?
FUN
the function to be applied. Additional arguments are passed by the ... argument.
n
[findThreshold] - a numeric value or vector giving number of extremes above the threshold. If n is not specified, n is set to an integer representing 5% of the data from the whole data set x
run
[deCluster] - parameter to be used in the runs method; any two consecutive threshold exceedances separated by more than this number of observations/days are considered to belong to different clusters.
x
a numeric data vector from which findThreshold and blockMaxima determine the threshold values and block maxima values. For the function deCluster the argument x rep
...
additional arguments passed to the FUN or plot function.

Value

  • findThreshold returns a numeric vector of suitable thresholds. blockMaxima returns a numeric vector of block maxima data. deCluster returns an object for the declustered point process.

Details

Finding Thresholds: The function findThreshold finds a threshold so that a given number of extremes lie above. When the data are tied a threshold is found so that at least the specified number of extremes lie above. Computing Block Maxima: The function blockMaxima calculates block maxima from a vector or a time series, whereas the function blocks is more general and allows for the calculation of an arbitrary function FUN on blocks. De-Clustering Point Processes: The function deCluster declusters clustered point process data so that Poisson assumption is more tenable over a high threshold.

References

Embrechts, P., Klueppelberg, C., Mikosch, T. (1997); Modelling Extremal Events, Springer Verlag.

See Also

MdaPlots, ExtremeIndexPlots, GpdFit, PotFit.

Examples

Run this code
## findThreshold -
   xmpExtremes("Start: Find Thresold >")
   # Find threshold giving (at least) fifty exceedances 
   # for Danish Fire data
   data(danish)
   findThreshold(danish, n = c(10, 50, 100))    
   
## blockMaxima -
   xmpExtremes("Next: Compute Block Maxima >")
   # Block Maxima (Minima) for the right and left tails 
   # of the BMW log returns:
   data(bmw)
   par(mfrow = c(2, 1))
   blockMaxima( bmw, block = 100)
   blockMaxima(-bmw, block = 100)     
 
## deCluster -
   xmpExtremes("Next: De-Cluster Exceedences >")
   # Decluster the 200 exceedances of a particular  
   # threshold in the negative BMW log-return data
   par(mfrow = c(2, 2))
   fit = potFit(-bmw, nextremes = 200) 
   deCluster(fit$fit$data, 30)

Run the code above in your browser using DataLab