Skip to contents

Estimate farness from a distance vector in order to identify outlier observations.

Usage

farness(dist, cutoff_value = NULL)

Arguments

dist

Vector of distances of each observation.

cutoff_value

Optional cutoff value between 0 and 1 to flag outliers. If provided, the function returns both the farness probabilities and the cutoff distance value in the original distance scale.

Value

Either a vector of farness probabilities for each observation (if cutoff_value is not provided) or a list containing (if cutoff_value is provided):

farness_probs

A vector of farness probabilities for each observation. Values between 0 and 1.

cutoff_value

The cutoff distance value in the original distance scale corresponding to the specified cutoff_value probability.

References

J. Raymaekers and P.J. Rousseeuw (2021). Transforming variables to central normality. Machine Learning. doi:10.1007/s10994-021-05960-5

Based on the cellWise package: Raymaekers J, Rousseeuw P (2023). cellWise: Analyzing Data with Cellwise Outliers. R package version 2.5.3, https://CRAN.R-project.org/package=cellWise.

Examples

data(creditcard)
credit_card_int <- creditcard$intData

# Compute squared Interval-Mahalanobis distance
credit_card_dist <- IMah_dist(credit_card_int)

credit_card_farness <- farness(credit_card_dist, cutoff_value = 0.9)