clust | R Documentation |
A function to identify clusters of exceedances of a time series.
clust(data, u, tim.cond = 1, clust.max = FALSE, plot = FALSE,
only.excess = TRUE, ...)
data |
A matrix/data.frame with two columns. Columns names must
be |
u |
Numeric. A value giving the threshold. |
tim.cond |
A time condition to ensure independence between
events. Should be in the same unit than |
clust.max |
Logical. If |
plot |
Logical. If |
only.excess |
Logical. If |
... |
Optional parameters to be passed in |
The clusters of exceedances are defined as follows:
The first exceedance initiates the first cluster;
The first observation under the threshold u
“ends” the
current cluster unless tim.cond
does not hold;
The next exceedance initiates a new cluster;
The process is iterated as needed.
This function differs from the function clusters
of evd
Package as independence condition i.e. tim.cond
could be a
“temporal” condition. That is, two events are considered independent
if the inter-arrival time is greater than a fixed duration.
However, it is also possible to used the “index” independence as in
clust
by setting data[,"time"] =
1:length(data[,"obs"])
.
If clust.max
is FALSE
, a list containing the clusters of
exceedances is returned. Else, a matrix containing the cluster maxima,
related dates and indices are returned.
In any case, the returned object has an attribute exi
giving
an estimation of the Extremal Index, that is the inverse of the
average cluster size.
Mathieu Ribatet
clusters
of package evd
.
data(ardieres)
par(mfrow=c(1,2))
clust(ardieres, 4, 10 / 365)
clust(ardieres, 4, 10 / 365, clust.max = TRUE)
clust(ardieres, 4, 10 / 365, clust.max = TRUE, plot = TRUE)
##The same but with optional arguments passed to function ``plot''
clust(ardieres, 4, 10 / 365, clust.max = TRUE, plot = TRUE,
xlab = "Time (Years)", ylab = "Flood discharges",
xlim = c(1972, 1980))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.