Description Usage Arguments Details References Examples
Returns the indices of the peaks above a threshold according to the declustering method put in place by the Water Resources Council. See Lang et al. (1999) for more details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | which.floodPeaks(x, ...)
## S3 method for class 'matrix'
which.floodPeaks(x, ...)
## S3 method for class 'data.frame'
which.floodPeaks(x, ...)
## S3 method for class 'formula'
which.floodPeaks(form, x, ...)
## S3 method for class 'numeric'
which.floodPeaks(x, dt = NULL, u, r = 1, rlow = 0.75,
ini = "lmax2")
which.clusters(x, u, ...)
|
x |
Sample. Can be a vector, matrix or data.frame.
If |
form |
Formula that describes the variables: |
dt |
Date or time of observations. |
u |
Threshold. |
r, rlow, ini |
Declustering parameters. See details. |
The declustering method performs two steps,
First an initial set of peaks are obtained.
By default, if ini = 'lmax'
the initial peaks are local maximums.
Alternatively, if ini = 'clust'
a simple run declustering
is realized to identify the maximums of
continuous clusters above the threshold u
.
Afterward two additional conditions are required for peaks to not be
rejected. First, two peaks Q1 and Q2 must be separated by a
period of at least r
days.
One recommendation is
5 days + log(A)
where A is the drainage area in miles. The second conditions is
Xmin > rlow * min(Q1,Q2).
By defautlt, rlow = 0.75
.
When one of the two conditions is not statisfied the lowest of the two
peaks is discarded.
Modified version of the previous algorithm is also implemented.
Using ini = 'lmax2'
. Instead of verify jointly both condition
a first series of peaks is extrated using only the second condition and
next the first condition is verify in the newly extracted peaks.
The two version are very similar and differ only on few cases where the
modified version is more conservative and reject peaks that are kept
in the initial version.
The function which.clusters
is returning the indices of the peaks
identified by the run declustering method. See clusters
.
Lang M, Ouarda TBMJ, Bobée B. (1999) Towards operational guidelines for over-threshold modeling. Journal of Hydrology. Dec 6;225(3):103–17.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | area <- 14700
b <- ceiling(5 + log(area/(1.609^2))) ## b = 14
xd <- canadaFlood$daily
# Declustering using recommendation.
cid <- which.floodPeaks(flow~date, xd,
u = 1000, r = b, rlow = .75, ini = 'lmax')
plot(xd, type = 'l')
points(canadaFlood$daily[cid,], col = 'red', pch = 16)
abline(h = 1000, col = 3, lwd = 2)
## Using a nonstationary threshold.
fit <- lm(log(flow)~date, canadaFlood$daily)
ut <- exp(fitted(fit))+900
lines(xd$date, ut, col = 4, lwd = 2)
cid <- which.floodPeaks(flow~date, xd,
u = ut, r = b, rlow = .75, ini = 'lmax')
points(canadaFlood$daily[cid,], col = 'yellow', pch = 16)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.