node_optimal_values {PhylogeneticEM} | R Documentation |
Computation of the optimal values at nodes and tips.
Description
compute_betas_from_shifts
computes the optimal values at the nodes and tips of the
tree, given the value at the root and the list of shifts occurring in the tree.
It assumes an OU model.
Usage
node_optimal_values(param, phylo)
Arguments
param |
an object of class |
phylo |
a phylogenetic tree, class |
Value
Matrix of size ntraits x (ntaxa + Nnode) of the optimal values at the node and tips of the tree. Column names correspond to the number of the node in the phylo object.
Examples
set.seed(1792)
ntaxa = 10
tree <- rphylo(ntaxa, 1, 0.1)
# parameters of the process
par <- params_process("BM", ## Process
p = 2, ## Dimension
variance = diag(0.5, 2, 2) + 0.5, ## Rate matrix
edges = c(4, 10, 15), ## Positions of the shifts
values = cbind(c(5, 4), ## Values of the shifts
c(-4, -5),
c(5, -3)))
plot(par, phylo = tree, traits = 1, value_in_box = TRUE,
shifts_bg = "white", root_bg = "white", ancestral_as_shift = TRUE, root_adj = 5)
nodelabels()
node_optimal_values(par, tree)
[Package PhylogeneticEM version 1.7.0 Index]