R: Calculate Multidimensional Densities from Neighbor Distances

neighbor.density {dissUtils} | R Documentation

## Calculate Multidimensional Densities from Neighbor Distances

### 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

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

### Arguments

`neigh.dists` | a vector of distances between members of a multivariate data set and their `k`th-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

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

[Package dissUtils version 1.0 Index]