Description Usage Arguments Value Examples
View source: R/Function_ComputeDistances_1Network_1Tree.R
This function returns a vector containing the Hellinger and KL distances between two tree models
1 2 3 4 | Function_ComputeDistances_1Network_1Tree(
list.Model_01_Network,
list.Model_02_Tree
)
|
list.Model_01_Network |
List containing the following (1) handle.Phylogeny, (2) string.Model = "BM", "OU", "EB", "lambda", "kappa", "delta", (3) vector.Z = vector of mean (ancestral) state values, and (4) vector.Model_01_Theta = vector containing relevant parameters for the models |
list.Model_02_Tree |
List containing the following (1) handle.Phylogeny, (2) string.Model = "BM", "OU", "EB", "lambda", "kappa", "delta", (3) vector.Z = vector of mean (ancestral) state values, and (4) vector.Model_01_Theta = vector containing relevant parameters for the models |
vector.Distances Vector containing the distances computed between the two focal tree models
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ################
# Load depends #
################
library(ape)
library(geiger)
library(gaussDiff)
library(BMhyd)
######################
# Simulate a network #
######################
handle.SimulatedNetwork <- SimulateNetwork(ntax.nonhybrid=5, ntax.hybrid=3,
flow.proportion=0.5, origin.type='clade', birth = 1, death = 0.5, sample.f = 0.5,
tree.height = 1, allow.ghost=FALSE)
###############################
# Set the first network model #
###############################
list.Model01_BM <- list(handle.Phylogeny = handle.SimulatedNetwork$phy,
handle.Flow = handle.SimulatedNetwork$flow,
string.Model = "BM",
vector.Z = rep(0, 8),
numeric.Sig2 = 1)
#############################
# Set the second tree model #
#############################
list.Model02_BM <- list(handle.Phylogeny = handle.SimulatedNetwork$phy,
string.Model = "BM",
vector.Z = rep(0, 8),
numeric.Sig2 = 1)
#####################
# Compute distances #
#####################
Function_ComputeDistances_1Network_1Tree(list.Model_01_Network = list.Model01_BM, list.Model_02_Tree = list.Model02_BM)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.