ueda_index: Find indexes and positions

Description Usage Arguments Value References Examples

View source: R/ueda_index.R

Description

This function allows identifying the indexes and positions of outliers in a numeric vector.

Usage

1
ueda_index(x, smax = 5)

Arguments

x

A numeric vector

smax

The maximum number of outliers to be detected. By default, smax = 3.

Value

A list with 2 components:

index Boolean (TRUE/FALSE) indicating whether each observation is an outlier.

position The position of the outliers in the data.

References

Marmolejo-Ramos, F., Vélez, J.I. & Romão, X. Automatic detection of discordant outliers via the Ueda’s method. J Stat Distrib App 2, 8 (2015). https://doi.org/10.1186/s40488-015-0031-y

Examples

1
2
3
4
5
6
7
8
# random seed for reproducibility
set.seed(13)
# introduce 5 outliers
x <- c(rnorm(25, 300, 10), rnorm(5, 400, 5))
# shuffle the data
x <- sample(x)
# find indexes
ueda_index(x, smax = 5)

jivelez/ueda documentation built on Dec. 21, 2021, 12:08 a.m.