powered by
Compute local outlier factors using k nearest neighbours. A local outlier factor is a measure of how anomalous each observation is based on the density of neighbouring points. The function uses dbscan::lof to do the calculation.
dbscan::lof
lof_scores(y, k = 10, ...)
Numerical vector containing LOF values
Numerical matrix or vector of data
Number of neighbours to include. Default: 5.
Additional arguments passed to dbscan::lof
Rob J Hyndman
y <- c(rnorm(49), 5) lof_scores(y)
Run the code above in your browser using DataLab