kernel_density_outliers <- function(traintrain_dists, traintest_dists=NULL, trainrandom_dists=NULL, outlier_fraction=0, kernel='gaussian', kernel_h0=1,estimate_kernel_h0=T,bandwidth=NULL, pval_cutoff=NULL,use_random_trees=T,pathbase=".", use_iterative_outliers=F, normalize_kernels=F, normalize_preds=T,kernel_h0_step=0.1,starting_h0=0.6) Standard usage: traintrain_dists: matrix of pairwise distances between input trees traintest_dists = NULL train_random_dists: matrix of distances between input trees and random trees (one row for each input tree) outlier_fraction: fraction of outliers to attempt to remove from the distribution estimation kernel: Either 'laplace', 'gaussian', 'gaussian1_5', 'gaussian2' which correspond to delta = 1,2,3,4 in the manuscript kernel_h0 = 1 estimate_kernel_h0 = T bandwidth = NULL pval_cutoff = NULL use_random_trees = T pathbase: path where messages file should be printed use_iterative_outliers = F normalize_kernels = F normalize_preds = T kernel_h0_step: Hill-climbing optimization of bandwidth will increase/decrease bandwidth by a factor of (1 + kernel_h0_step) at each step starting_h0: Starting value of bandwidth will be starting_h0 times the square-root of second moment of pairwise distances between input trees Output: List with members unbiased_density_sums: Probability estimate for each input tree, times number of all possible tree topologies (i.e., likelihood ratio versus uniform random distribution on trees) estimated_kernel_h0: ML estimate of bandwidth multiplier. (ML bandwidth is estimated_kernel_h0 times the square-root of second moment of pairwise distances between input trees)