simulate_internal
simulate a stochastic process on a tree.
simulate_internal(
phylo,
process = c("BM", "OU", "scOU", "OUBM", "StudentOU"),
p = 1,
root.state = list(random = FALSE, stationary.root = FALSE, value.root = NA, exp.root =
NA, var.root = NA),
shifts = list(edges = NULL, values = NULL, relativeTimes = NULL),
eps = 10^(-6),
selection.strength = NULL,
variance = NULL,
optimal.value = NULL,
checks = TRUE,
simulate_random = TRUE,
U_tree = NULL,
times_shared = NULL,
df = 1
)
paramSimu An array with dimensions p x Nnode x 2 (BM) or p x Nnode x 3 (OU). For each trait t, 1 <= t <= p, paramSimu[t, , ] has tree columns, containing respectively the simulated state, expected value and optimal value for all the nodes.
a phylogenetic tree, class phylo
.
The model used for the simulation. One of "BM" (for a full BM model, univariate or multivariate); "OU" (for a full OU model, univariate or multivariate); or "scOU" (for a "scalar OU" model).
Dimension of the simulated trait
List describing the state of the root, with:
random state (TRUE) or deterministic state (FALSE)
if deterministic, value of the character at the root
if random, expectation of the character at the root
if random, variance of the character at the root (pxp matrix)
List with position and values of the shifts :
vector of the K id of edges where the shifts are
matrix p x K of values of the shifts on the edges (one column = one shift)
vector of dimension K of relative time of the shift from the parent node of edges
Tolerance for the value of the norm 1 of the selection strength matrix for OU
Matrix of selection strength size p x p (OU)
Variance-covariance matrix size p x p
Vector of p optimal values at the root (OU)
whether to check the entry parameters for consistency. Default to TRUE.
set to FALSE if only the expected values are needed (and not the random sample). Default to TRUE.
optional, full incidence matrix of the tree, result of function
incidence.matrix.full
.
optional, times of shared ancestry of all nodes and tips,
result of function compute_times_ca
. Can be specified to avoid extra
computations.
if the process is "StudentOU", the number of degree of freedom of the chosen student law. default to 1.