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.
Usage
lof_scores(y, k = 10, ...)
Value
Numerical vector containing LOF values
Arguments
y
Numerical matrix or vector of data
k
Number of neighbours to include. Default: 5.
...
Additional arguments passed to dbscan::lof
Author
Rob J Hyndman
References
Rob J Hyndman (2026) "That's weird: Anomaly detection using R", Section 7.3,
https://OTexts.com/weird/.