mxOption(model, key, value, reset = FALSE)Use value = NULL to remove an existing option. Leaving value blank will return
the current value of the option specified by
To reset all options to their default values, use
If the
To see the defaults, use getOption('mxOptions').
Before the model is submitted to the back-end, all keys and values are converted into strings using the as.character function.
The model=NULL), and not specifically to a given MxModel.
Currently, options
The maximum number of major iterations (the option
OpenMx options
detectCores()
to find how many are available.
Calculate Hessian [Yes | No] calculate the Hessian explicitly after optimization.
Standard Errors [Yes | No] return standard error estimates from the explicitly calculate hessian.
Default optimizer [NPSOL | SLSQP | CSOLNP] the gradient-descent optimizer to use
Number of Threads [0|1|2|...|10|...] number of threads used for optimization. This is how parallelism works. Default value of 0 uses detectCores() - 1.
Feasibility tolerance r the maximum acceptable absolute violations in linear and nonlinear constraints.
Optimality tolerance r the maximum acceptable difference in fit.
Gradient algorithm see list finite difference method, either 'forward' or 'central'.
Gradient iterations 1:4 the number of Richardson extrapolation iterations
Analytic Gradients [Yes | No] should the optimizer use analytic gradients (if available)?
loglikelihoodScale i factor by which the loglikelihood is scaled.
}
NPSOL-specific options
CSOLNP-specific options
Checkpointing options
Model transformation options
Multivariate normal integration parameters
# set the Numbder of Threads (cores to use)
mxOption(NULL, "Number of Threads", detectCores() - 1)
testModel <- mxModel(model = "testModel") # make a model to use for example
testModel$options # show the model options (none yet)
options()$mxOptions # list all mxOptions (global settings)
testModel <- mxOption(testModel, "Function precision", 1e-5) # set precision
testModel <- mxOption(testModel, "Function precision", NULL) # clear precision
# N.B. This is model-specific precision (defaults to global setting)
# may optimize for speed
# at cost of not getting standard errors
testModel <- mxOption(testModel, "Calculate Hessian", "No")
testModel <- mxOption(testModel, "Standard Errors" , "No")
testModel$options # see the list of options you setRun the code above in your browser using DataLab