simulate_internal {PhylogeneticEM} | R Documentation |
Simulate a Stochastic Process on a tree
Description
simulate_internal
simulate a stochastic process on a tree.
Usage
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
)
Arguments
phylo |
a phylogenetic tree, class |
process |
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). |
p |
Dimension of the simulated trait |
root.state |
List describing the state of the root, with:
|
shifts |
List with position and values of the shifts :
|
eps |
Tolerance for the value of the norm 1 of the selection strength matrix for OU |
selection.strength |
Matrix of selection strength size p x p (OU) |
variance |
Variance-covariance matrix size p x p |
optimal.value |
Vector of p optimal values at the root (OU) |
checks |
whether to check the entry parameters for consistency. Default to TRUE. |
simulate_random |
set to FALSE if only the expected values are needed (and not the random sample). Default to TRUE. |
U_tree |
optional, full incidence matrix of the tree, result of function
|
times_shared |
optional, times of shared ancestry of all nodes and tips,
result of function |
df |
if the process is "StudentOU", the number of degree of freedom of the chosen student law. default to 1. |
Value
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.