Adaptation of Varty et al.'s metric-based threshold automated diagnostic for the independent and identically distributed case with no rounding.
Arguments
- xdat
vector of observations
- thresh
vector of thresholds
- B
number of bootstrap replications
- type
string indicating scale, either
qqfor exponential quantile-quantile plot orppfor probability-probability plot (uniform)- dist
string indicating norm, either
l1for absolute error orl2for quadratic error- neval
number of points at which to estimate the metric. Default to 1000L
- ci
level of symmetric confidence interval. Default to 0.95
Value
an invisible list with components
threshscalar threshold minimizing criterioncthreshvector of candidate thresholdsmetricvalue of the metric criterion evaluated at each thresholdtypeargumenttypedistargumentdist
Details
The algorithm proceeds by first computing the maximum likelihood algorithm and then simulating datasets from replication with parameters drawn from a bivariate normal approximation to the maximum likelihood estimator distribution.
For each bootstrap sample, we refit the model and convert the quantiles to exponential or uniform variates. The mean absolute or mean squared distance is calculated on these. The threshold returned is the one with the lowest value of the metric.