omxParallelCI {OpenMx}R Documentation

Dedicated functions for calculating confidence intervals without redoing the primary optimization.

Description

omxParallelCI() calculates confidence intervals for an already-run MxModel object that contains an MxInterval object (i.e., an mxCI() statement), without recalculating point estimates, fitfunction derivatives, or expectations. The "parallel" in the function's name refers to the not-yet-implemented feature of running independent submodels in parallel. omxRunCI() is a wrapper for omxParallelCI() with arguments run=TRUE and independentSubmodels=FALSE, and is the recommended interface.

Usage

omxParallelCI(model, run = TRUE, verbose=0L, independentSubmodels=TRUE,
optimizer=mxOption(NULL,"Default optimizer"))

omxRunCI(model, verbose=0L, optimizer="SLSQP")

Arguments

model

An MxModel object that contains an MxInterval object (i.e., an mxCI() statement).

run

Logical; should the resulting MxModel object be passed through mxRun() before being returned? Defaults to TRUE (for omxParallelCI()).

verbose

Integer; defaults to zero; verbosity level passed to MxCompute* objects.

independentSubmodels

Logical; defaults to TRUE (for omxParallelCI()). See below under "Details."

optimizer

Character string selecting the gradient-descent optimizer to be used to find confidence limits; one of "NPSOL", "CSOLNP", or "SLSQP". The default for omxParallelCI() is the current value of mxOption "Default optimizer", and for omxRunCI(), is "SLSQP".

Details

When independentSubmodels=TRUE, omxParallelCI() creates an independent MxModel object for each quantity specified in the 'reference' slot of model's MxInterval object, and places these independent MxModels inside model. Each of these independent submodels calculates the confidence limits of its own quantity when the container model is run. When independentSubmodels=FALSE, no submodels are added to model. Instead, model is provided with a dedicated compute plan consisting only of an MxComputeConfidenceInterval step. Note that using independentSubmodels=FALSE will overwrite any compute plan already inside model.

Value

The functions return model, augmented with independent submodels (if independentSubmodels=TRUE) or with a non-default compute plan (if independentSubmodels=FALSE), and possibly having been passed through mxRun() (if run=TRUE). Naturally, if run=FALSE, the user can subsequently run the returned model to obtain confidence intervals. Users are cautioned that the returned model may not be very amenable to being further modified and re-fitted (e.g., having some free parameters fixed via omxSetParameters() and passed through mxRun() to get new point estimates) unless the added submodels or the non-default compute plan are eliminated. The exception is if run=TRUE and independentSubmodels=TRUE (which is always the case with omxRunCI()), since the non-default compute plan is set to be non-persistent, and will automatically be replaced with a default compute plan the next time the model is passed to mxRun().

See Also

mxCI(), MxInterval, mxComputeConfidenceInterval()

Examples

require(OpenMx)
data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")
factorModel <- mxModel("One Factor", 
	type="RAM",
	manifestVars=manifests, 
	latentVars=latents,
	mxPath(from=latents, to=manifests),
 	mxPath(from=manifests, arrows=2),
	mxPath(from=latents, arrows=2, free=FALSE, values=1.0),
	mxData(observed=cov(demoOneFactor), type="cov",
		numObs=500),
# add confidence intervals for free params in A and S matrices
	mxCI(c('A', 'S')))
factorRun <- mxRun(factorModel)
factorCI <- omxParallelCI(factorRun) 
factorCI2 <- omxRunCI(factorRun)

[Package OpenMx version 2.8.3 Index]