density_points: denpoints

Description Usage Arguments Details Value Author(s) References Examples

View source: R/density_points.R

Description

density_points Estimates the densities values of a sample.

Usage

1
density_points(data, neigh = 4)

Arguments

x

A distance matrix calculated on data or a matrix

k

The number of nearest neighbors to calculate local point density

Details

For a fixed y, density of y is defined as the sum of distance(y,z) on all z that are the k-nearest neighbors of y

Value

dpoints

A real vector containing the density values for each point

Author(s)

Juan Domingo Gonzalez <juanrst@hotmail.com>

References

Hasan AM, et al. Robust partitional clustering by outlier and density insensitive seeding. Pattern Recognition Letters, 30(11), 994-1002, 2009.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## generate normal data in dimension 2
X <- matrix(rnorm(1000), ncol = 2)
a <- denpoints(x = X, k = 4)


## ten most isolated points
most_isolated = order(a)[1:10]

## plotting results: (most isolated points should be shown in green)
plot(X)
points(X[ most_isolated, ], pch = 19, col = 3)

anevolbap/ktaucenterscpp documentation built on March 10, 2021, 10:12 a.m.