apply_hampel_identifier: Function to apply the Hampel identifier, a median absolute...

View source: R/apply_hampel_identifier.R

apply_hampel_identifierR Documentation

Function to apply the Hampel identifier, a median absolute deviation (MAD) outlier detector.

Description

The Hampel identifier is robust against outliers and omits all missing (NA) elements before calculation.

Usage

apply_hampel_identifier(x, k = 60, t0 = 3, values = FALSE, na_preserve = TRUE)

Arguments

x

A numeric vector, typically a time series.

k

An integer representing the window length of x that is evaluated for the outlier detection.

t0

The outlier threshold. The default of 3 is Ron Pearson's three-sigma edit rule.

values

Should the filtered verson of the x vector be returned rather than a logical vector representing the identification of outliers?

na_preserve

If value is TRUE, should the missing elements of x be propagated into the returned numeric vector?

Value

Numeric or logical vector depending on values.

Author(s)

Hans W. Borchers and Stuart K. Grange

See Also

https://github.com/cran/pracma


skgrange/threadr documentation built on April 15, 2024, 9:35 p.m.