mxFitFunctionMultigroup {OpenMx}R Documentation

Aggregate fit statistics from multiple submodels

Description

mxFitFunctionMultigroup creates a fit function consisting of the sum of the fit statistics from a list of submodels provided.

This is conceptually similar to creating an mxAlgebra consisting of the sum of the subModel objectives and also creating an algebra fit function to optimize the model based on this aggregate value.

This call to mxFitFunctionMultigroup:

mxFitFunctionMultigroup(c("model1", "model2"))

then, is almost equivalent to the following pair of statements:

mxAlgebra(model1.objective + model2.objective, name="myAlgebra")

mxFitFunctionAlgebra("myAlgebra")

In addition to being more compact and readable, using mxFitFunctionMultigroup has additional side effects which are valuable for multi-group modeling.

Firstly, it aggregates analytic derivative calculations. Secondly, it allows mxRefModels to compute saturated models for raw data, as this function can learn which are the constituent submodels.

Note: You can refer to the algebra generated by mxFitFunctionMultigroup when used in a group "modelName" as:

modelName.fitfunction

Usage

mxFitFunctionMultigroup(groups, ..., verbose = 0L)

Arguments

groups

vector of fit function names (strings)

...

Not used. Forces subsequent arguments to be specified by name.

verbose

the level of debugging output

Examples

require("OpenMx")
mxFitFunctionMultigroup(c("model1", "model2")) # names of sub-models to be jointly optimised

[Package OpenMx version 2.2.4 Index]