compute_expectations.BM: Compute the expected states of a BM

View source: R/simulate.R

compute_expectations.BMR Documentation

Compute the expected states of a BM

Description

compute_expectations.BM use the matrix formulation to compute the expected values at all the nodes.

Usage

compute_expectations.BM(phylo, root.state, shifts, U_tree = NULL)

Arguments

phylo

Input tree.

root.state

(list): state of the root, with: random : random state (TRUE) or deterministic state (FALSE) value.root : if deterministic, value of the character at the root exp.root : if random, expectation of the character at the root var.root : if random, variance of the character at the root (pxp matrix)

shifts

(list) position and values of the shifts : edges : vector of the K id of edges where the shifts are values : matrix p x K of values of the shifts on the edges (one column = one shift) relativeTimes : vector of dimension K of relative time of the shift from the parent node of edges

Value

paramSimu: array p x Nnode x 2 (BM). For each trait t, 1 <= t <= p, paramSimu[t, , ] has two columns, both containing the expected values for all the nodes.


pbastide/PhylogeneticEM documentation built on Feb. 12, 2024, 1:27 a.m.