Generate trait data on a tree according to a multivariate stochastic model with one or several regimes

PCMSim(tree, model, X0, metaI = PCMInfo(X = NULL, tree = tree, model =
  model, verbose = verbose), verbose = FALSE)

Arguments

tree

a phylo object specifying a rooted tree.

model

an S3 object specifying the model (see Details).

X0

a numeric vector of length k (the number of traits) specifying the trait values at the root of the tree.

metaI

a named list containg meta-information about the data and the model.

verbose

a logical indicating if informative messages should be written during execution.

Value

numeric M x k matrix of values at all nodes of the tree, i.e. root, internal and tip, where M is the number of nodes: M=dim(tree$edge)[1]+1, with indices from 1 to N=length(tree$tip.label) corresponding to tips, N+1 corresponding to the root and bigger than N+1 corresponding to internal nodes. The function will fail in case that the length of the argument vector X0 differs from the number of traits specified in metaI$k. Error message: "ERR:02002:PCMBase:PCM.R:PCMSim:: X0 must be of length ...".

Details

Internally, this function uses the PCMCond iimplementation for the given model class.

See also