Skip to contents

Same as identify_vector_outliers_global() except the quantile computation is performed in a sliding window centered on each sample. Currently the computation is not really efficient and runs in O (n*w*log (w)) for window size w.

Usage

identify_vector_outliers_window(
  .input,
  .window = 333,
  .limit = 0.05,
  .slack = 0.1
)

Arguments

.input

Sample vector.

.window

Window size in samples.

.limit

Quantile that separates inliers from outliers.

.slack

Tolerated distance from limit quantile.

Value

Boolean vector of outlier flags.

Examples

# A sample of 100 is considered an outlier when near
# different values but not when near similar values.
identify_vector_outliers_window (c (100, 15:25, 95:105, 100), .window = 10)
#>  [1]  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE