This function computes the empirical coefficient of variation and computes a weighted statistic comparing the squared distance with the theoretical coefficient variation corresponding to a specific shape parameter (estimated from the data using a moment estimator as the value minimizing the test statistic, or using maximum likelihood). The procedure stops if there are no more than 10 exceedances above the highest threshold
Usage
cvselect(
xdat,
thresh,
method = c("mle", "wcv", "cv"),
nsim = 999L,
nthresh = 10L,
level = 0.05,
lazy = FALSE
)
Arguments
- xdat
[vector] vector of observations
- thresh
[vector] vector of threshold. If missing, set to \(p^k\) for \(k=0\) to \(k=\)
nthresh
- method
[string], either moment estimator for the (weighted) coefficient of variation (
wcv
andcv
) or maximum likelihood (mle
)- nsim
[integer] number of bootstrap replications
- nthresh
[integer] number of thresholds, if
thresh
is not supplied by the user- level
[numeric] probability level for sequential testing procedure
- lazy
[logical] compute the bootstrap p-value until the test stops rejecting at level
level
? Default toFALSE
Value
a list with elements
threshvalue of threshold returned by the procedure,
NA
if the hypothesis is rejected at all thresholdscthreshsorted vector of candidate thresholds
cindexindex of selected threshold among
cthresh
orNA
if none returnedpvalbootstrap p-values, with
NA
iflazy
and the p-value exceeds level at lower thresholdsshapeshape parameter estimates
nexcnumber of exceedances of each threshold
cthresh
methodestimation method for the shape parameter