Convert a GaussianPCM model object to a MixedGaussian model object

as.MixedGaussian(o, modelTypes = NULL)

Arguments

o

an R object: either a GaussianPCM or a MixedGaussian.

modelTypes

NULL (the default) or a (possibly named) character string vector. Each such string denotes a mixed Gaussian regime model class, e.g. the result of calling MGPMDefaultModelTypes(). If specified, an attempt is made to match the deduced Gaussian regime model type from o with the elements of modelTypes and an error is raised if the match fails. If the match succeeds the converted MixedGaussian object will have the specified modelTypes parameter as an attribute "modelTypes".

Value

a MixedGaussian object.

Examples

mg <- as.MixedGaussian(PCMBaseTestObjects$model.ab.123.bSigmae_x) stopifnot( PCMLik( X = PCMBaseTestObjects$traits.ab.123, PCMBaseTestObjects$tree.ab, PCMBaseTestObjects$model.ab.123.bSigmae_x) == PCMLik( X = PCMBaseTestObjects$traits.ab.123, PCMBaseTestObjects$tree.ab, mg))