MixedGaussian {PCMBase}R Documentation

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 specifying the number of traits.

modelTypes, mapping

These two arguments define the mapping between the regimes in the model and actual types of models. For convenience, different combinations are possible as explained below:

  • modelTypes is a (possibly named) character string vector. Each such string denotes a mixed Gaussian regime model class, e.g. the result of calling MGPMDefaultModelTypes(). In that case mapping can be either an integer vector with values corresponding to indices in modelTypes or a character string vector. If mapping is a character string vector, first it is matched against names(modelTypes) and if the match fails either because of names(modelTypes) being NULL or because some of the entries in mapping are not present in names(modelTypes), then an attempt is made to match mapping against modelTypes, i.e. it is assumed that mapping contains actual class names.

  • modelTypes is a (possibly named) list of PCM models of k traits. In this case mapping can again be an integer vector denoting indices in modelTypes or a character string vector denoting names in modelTypes.

As a final note, mapping can also be named. In this case the names are assumed to be the names of the different regimes in the model. If mapping is not named, the regimes are named automatically as as.character(seq_len(mapping)). For example, if modelTypes = c("BM", "OU") and mapping = c(a = 1, b = 1, c = 2, d = 1) defines an MixedGaussian with four different regimes named 'a', 'b', 'c', 'd', and model-types BM, BM, OU and BM, corresponding to each regime.

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.

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

Value

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

See Also

PCMTreeGetPartNames

PCMModels()


[Package PCMBase version 1.2.14 Index]