neighbor.density: Calculate Multidimensional Densities from Neighbor Distances

Description Usage Arguments Value References Examples

View source: R/neighbor_density.R

Description

neighbor.density estimates the density around a point by accounting for the dimensionality of the space the neighbors are in, the total number of points in the space, and how many neighbors are found at least as close to the point as the density given.

Usage

1
neighbor.density(neigh.dists, D, k, N)

Arguments

neigh.dists

a vector of distances between members of a multivariate data set and their kth-nearest neighbor

D

the number of dimensions of the multivariate space

k

the number of neighbors found around each point within the hyperspheres with radii given in neigh.dists

N

the total number of points in the data set from which the neighbors are drawn. This may not be equal to length(neigh.dists) if the neighbors are in a separate data set from the points of interest.

Value

a numeric vector of densities

References

http://en.wikipedia.org/wiki/N-sphere

Examples

1
2
3
4
5
6
## The function is currently defined as
function (neigh.dists, D, k, N)
{
    radius <- unit.hypersphere.volume(D)
    return(k/(N * radius * neigh.dists))
  }

dissUtils documentation built on May 1, 2019, 7:28 p.m.