Skip to contents

The outlier detection method is based on quantiles but permits retaining short tails. A sample is considered an outlier if it is outside an interval computed as (lo - range * slack, hi + range * slack) with lo and hi denoting the limit and 1 - limit quantiles and range = hi - lo.

Usage

identify_vector_outliers_global(.input, .limit = 0.05, .slack = 0.1)

Arguments

.input

Sample vector.

.limit

Quantile that separates inliers from outliers.

.slack

Tolerated distance from limit quantile.

Value

Boolean vector of outlier flags.

Examples

# An outlier gets flagged.
identify_vector_outliers_global (c (1:10, 100))
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE

# No outlier gets flagged with short tails.
identify_vector_outliers_global (1:10)
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE