bw.nn {TML}R Documentation

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)

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

Value

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

Author(s)

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


T1<-Sim_Trees15
T2<-Sim_Trees25
D <- rbind(T1, T2[1,])
M <- pw.trop.dist(D, D)
bw.nn(M)


[Package TML version 2.3.0 Index]