Create a multi-regime Gaussian model (MixedGaussian)
MixedGaussian(k, modelTypes, mapping,
className = paste0("MixedGaussian_", do.call(paste0,
as.list(mapping))), X0 = structure(0, class = c("VectorParameter",
"_Global"), description = "trait values at the root"), ...,
Sigmae_x = structure(0, class = c("MatrixParameter",
"_UpperTriangularWithDiagonal", "_WithNonNegativeDiagonal", "_Global"),
description =
"Upper triangular factor of the non-phylogenetic variance-covariance"))
integer defining the number of traits.
a character string vector with the class names of the
model-types that can possibly be included (assigned to regimes) in the
MixedGaussian, e.g. c("BM", "OU") (see also PCMModels
).
a character string vector with elements from modelTypes or an
integer vector with elements between 1 and length(modelTypes)
mapping modelTypes to regimes, e.g. if modelTypes = c("BM", "OU")
and
mapping = c(a = 1, b = 1, c = 2, d = 1)
defines an MixedGaussian with
four different regimes with model-types BM3, BM3, OU3 and BM3, corresponding
to each regime. mapping
does not have to be a named vector. If it is a
named vector, then all the names must correspond to valid regime names in a
tree to which the model will be fit or simulated (member tree$edge.part
should be a character vector). If it is not a named vector then the positions
of the elements correspond to the regimes in their order given by the
function PCMTreeGetPartNames
called on a tree object.
a character string defining a valid S3 class name for the
resulting MixedGaussian object. If not specified, a className is generated
using the expression
paste0("MixedGaussian_", do.call(paste0, as.list(mapping)))
.
specification for the global vector X0 to be used by all models in the MixedGaussian.
specifications for other _Global parameters coming after X0.
sepcification of a _Global Sigmae_x parameter. This is used by Submodels only if they have Sigmae_x _Omitted.
an object of S3 class className inheriting from MixedGaussian, GaussianPCM and PCM.
If X0 is not NULL it has no sense to use model-types including X0 as a parameter (e.g. use BM1 or BM3 instead of BM or BM2). Similarly if Sigmae_x is not NULL there is no meaning in using model-types including Sigmae_x as a parameter, (e.g. use OU2 or OU3 instead of OU or OU1).