Description Usage Arguments Details Value Examples
The local outlier factor (LOF) compares the local density of a value to the average local density of its k nearest neighbors. If the ratio of the densities (the LOF) is significantly higher than 1, the point is an outlier and can be discarded. This function uses a highly simplified calculation to trim outlier values from the upper tail of 1-dimensional data.
1 | lof1d(x, k = 5, cutoff = 3)
|
x |
A vector of values. |
k |
The number of nearest neighbors to consider. Also the number of upper tail values considered as possible outliers. |
cutoff |
The maximum LOF for a value to be retained. |
If length(x) is less than 3*k, the vector is returned unchanged. See the Wikipedia page for a description of the LOF algorithm: https://en.wikipedia.org/wiki/Local_outlier_factor
The input vector x
with any of the k
largest
values that have an LOF greater than cutoff
removed.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.