Learn R Programming

BMhyb (version 1.5.2)

AdjustForDet: Adjust the phylogeny.

Description

Utility function to adjust the phylogeny to deal with numerical issues.

Usage

AdjustForDet(phy, max.attempts=100)

Arguments

phy

an object of class 'phylo'.

max.attempts

the maximum number of attempts to adjust the phylogeny. The default is 100.

Value

an object of class 'phylo'.

Details

This function first calculates the determinant of the phylogeny using the function DetPass. When the determinant of the variance covariance matrix for the phylogeny is negative, this function will adjust the phylogeny by slightly lengthening the edge lengths of the tree. This procedure repeats until a well adjusted phylogeny is returned.

References

Jhwueng D.C. and O'Meara B.C. 2016. Studying trait evolution in hybrid species on phylogenetic networks. Submitted.

Examples

Run this code
# NOT RUN {
	library(ape)
	#simulate a tree of 5 taxa
	phy<-rtree(5)
	#check and adjust the phylogeny
	AdjustForDet(phy,max.attempts=100)
	
# }

Run the code above in your browser using DataLab