simulate
simulate a stochastic process on a tree.
simul_process(x, ...)
# S3 method for params_process
simul_process(
x,
phylo,
simulate_random = TRUE,
checks = TRUE,
U_tree = NULL,
times_shared = NULL,
...
)
# S3 method for PhyloEM
simul_process(
x,
simulate_random = TRUE,
checks = TRUE,
U_tree = NULL,
times_shared = NULL,
...
)
an object of class params_process
or PhyloEM
.
for a PhyloEM
object, further arguments to be passed on to
params_process.PhyloEM
(to choose which parameters to extract from
the results, see documentation of this function).
a phylogenetic tree, class phylo
.
set to FALSE if only the expected values are needed (and not the random sample). Default to TRUE.
whether to check the entry parameters for consistency. Default to TRUE.
optional, full incidence matrix of the tree, result of function
incidence.matrix.full
. Can be specified to avoid extra computations.
optional, times of shared ancestry of all nodes and tips,
result of function compute_times_ca
. Can be specified to avoid extra
computations.
An S3 object of class simul_process
. This contains:
an array with dimensions p x Nnode x 2 (BM) or p x Nnode x 3 (OU). For each trait t, 1 <= t <= p, sim_traits[t, , ] has tree columns, containing respectively the simulated state, expected value and optimal value for all the nodes.
the phylogenetic tree used for the simulations (class phylo
).
the parameters used for the simulations
(class params_proces
).
params_process
: params_process
object
PhyloEM
: PhyloEM
object