ctbi.outlier {ctbi} | R Documentation |
ctbi.outlier
Description
Please cite the following companion paper if you're using the ctbi
package: Ritter, F.: Technical note: A procedure to clean, decompose, and aggregate time series, Hydrol. Earth Syst. Sci., 27, 349–361, https://doi.org/10.5194/hess-27-349-2023, 2023.
Outliers in an univariate dataset y
are flagged using an enhanced box plot rule (called Logbox, input: coeff.outlier
) that is adapted to non-Gaussian data and keeps the type I error at % (percentage of erroneously flagged outliers).
The box plot rule flags data points as outliers if they are below or above
using the sample quantile
:
Logbox replaces the original constant of the box plot rule with
. The variable
is the sample size,
corrects biases emerging in small samples, and
and
are automatically calculated on a predictor of the maximum tail weight defined as
.
The two functions (,
) are defined as:
And finally, and
with
restricted to [0,2]. The functions
are defined as:
Both functions have been calibrated on the Generalized Extreme Value and Pearson families.
Usage
ctbi.outlier(y, coeff.outlier = "auto")
Arguments
y |
univariate data (numeric vector) |
coeff.outlier |
one of |
Value
A list that contains:
xy, a two columns data frame that contains the clean data (first column) and the outliers (second column)
summary.outlier, a vector that contains A, B, C, , the size of the residuals (n), and the lower and upper outlier threshold
Examples
x <- runif(30)
x[c(5,10,20)] <- c(-10,15,30)
example1 <- ctbi.outlier(x)