Learn R Programming

TML (version 2.3.0)

bw.nn: Nearest neighbor bandwidth calculation

Description

This function finds the bandwidth for an ultrametric based on the tropical distance of the nearest point. The function provides the bandwidth input to trop.KDE and was originally used in the KDETrees package.

Usage

bw.nn(x, prop = 0.2, tol = 1e-06)

Value

a vector of bandwidths for each tree (row) in x

Arguments

x

matrix; dissimilarity matrix between points in a data set

prop

proportion of observations that defines neighborhood of a point

tol

tolerance for zero bandwidth check

Author

Ruriko Yoshida ryoshida@nps.edu

References

Weyenberg, G., Huggins, P., Schardl, C., Howe, D. K., & Yoshida, R. (2014). kdetrees: Nonparametric Estimation of Phylogenetic Tree Distributions. In Bioinformatics.

https://github.com/grady/kdetrees/blob/master/R/bw.R

Examples

Run this code
# \donttest{
T1<-Sim_Trees15
T2<-Sim_Trees25
D <- rbind(T1, T2[1,])
M <- pw.trop.dist(D, D)
bw.nn(M)
# }

Run the code above in your browser using DataLab