R/neighbor_density.R

Defines functions neighbor.density

Documented in neighbor.density

neighbor.density <- function(neigh.dists, D, k, N){

    return(ifelse(neigh.dists > 0,
                  exp(log(k)
                      - ( log(N)
                         + log(unit.hypersphere.volume(D))
                         + D * log(neigh.dists)
                         )
                      ),
                  0)
           );
}

Try the dissUtils package in your browser

Any scripts or data that you put into this service are public.

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