Learn R Programming

climtrends (version 1.0.6)

FindOutliersHampel: Find outliers based on quantiles

Description

FindOutliersHampel returns the position of the values outside the allowed range by the Hampel method.

Usage

FindOutliersHampel(X, Y, DX=NA, Th=NA, hampelAdaptive=FALSE,Threshold=NA)

Arguments

X
vector with data
Y
vector with data, Gaussian distributed
DX
half width of the filter window
Th
threshold value used in the equation |Y - Y0| > T*S0
hampelAdaptive
logical, TRUE=experimental adaptive Hampel filter
Threshold
adaptive threshold

Value

Vector with the positions of the outliers.

Source

Pearson RK, 2012 Mining Imperfect Data: Dealing with Contamination and Incomplete Records urlhttp://exploringdatablog.blogspot.com/2012/01/moving-window-filters-and-pracma.html Michael Lindholm Nielsen, 2012 urlhttp://www.mathworks.com/matlabcentral/fileexchange/34795-outlier-detection-and-removal--hampel-

References

Pearson RK, 2012 Mining Imperfect Data: Dealing with Contamination and Incomplete Records urlhttp://exploringdatablog.blogspot.com/2012/01/moving-window-filters-and-pracma.html

Michael Lindholm Nielsen, 2012 urlhttp://www.mathworks.com/matlabcentral/fileexchange/34795-outlier-detection-and-removal--hampel-

Examples

Run this code
X <- 1:1000 # Pseudo Time
Y <- 5000 + rnorm(1000) # Pseudo Data
Outliers <- sample(1:1000, 10, replace =FALSE) # Index of Outliers
Y[Outliers] <- Y[Outliers] + sample(1:1000, 10, replace =FALSE) # Pseudo Outliers
tmp <- FindOutliersHampel(X, Y)

Run the code above in your browser using DataLab