cvtree: CV Tree score

Description Usage Arguments Value Examples

View source: R/basefunctions.R

Description

CV Tree score

Usage

1
cvtree(tree, chars_test, root, nsim = 10, cl = 1, normalize = TRUE)

Arguments

tree

an object of the class "phylo" which the function will evaluate

chars_test

a matrix in which each row name is a tip of "tree" and each column is a hold-out character (typically not used in the construction of tree)

root

the tip of "tree" that should be used as a root

nsim

number of Monte Carlo simulations to be used by simmap. Defaults to 10

cl

Number of cores to be used. Defaults to 1

normalize

Whether edge lengths should be normalized to have the same value. Defaults to TRUE

Value

A list with two components: mean_score, the estimated predictive score (smaller is better), and sd_score, its standard error

Examples

1
2
3
4
set.seed(0)
my_tree<- ape::rtree(n=26,tip.label=LETTERS)
chars_test <- replicate(2,ape::rTraitDisc(my_tree,rate = 0.5))
cvtree(my_tree,chars_test,root="A")

rizbicki/cvtree documentation built on Dec. 22, 2021, 5:07 p.m.