PCMBase (version 1.2.10)

MixedGaussian: Create a multi-regime Gaussian model (MixedGaussian)

Description

Create a multi-regime Gaussian model (MixedGaussian)

Usage

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"))

Arguments

k

integer defining the number of traits.

modelTypes

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).

mapping

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.

className

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))).

X0

specification for the global vector X0 to be used by all models in the MixedGaussian.

...

specifications for other _Global parameters coming after X0.

Sigmae_x

sepcification of a _Global Sigmae_x parameter. This is used by Submodels only if they have Sigmae_x _Omitted.

Value

an object of S3 class className inheriting from MixedGaussian, GaussianPCM and PCM.

Details

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).

See Also

PCMTreeGetPartNames

PCMModels()