mxRun help

The job of mxRun() is to send a Model to the Optimizer, which will optimize the model, i.e. will seek out values for all the free parameters in your model which maximise the likelihood of an objective function (which you also have to provide)

You call mxRun as follows:

<strong>mxRun</strong>(<em>model</em>)

where "model" is an mxModel object to be optimized. After it has run, mxRun returns a model, with the free parameters now set to their optimized values, and an "@output" component or "slot" with the results of the optimization.

Unlike much some other functions and packages you may be used to in R, OpenMx package separates the process of assembling your model and submodels from the the process of running the model. Imagine that instead of saying

Common Problems:

While OpenMx does a valiant job at error-checking the components of a model as they are created, much of the validity of a model cannot be assessed until it is run. Problems in your model which mxRun may highlight include:

Not including an appropriate objective function.

The solution to this error is usually to ensure the top-level model includes the objective functions of its submodels, as well as an additional objective function describing how the results of the first two should be combined.

Including models which are dependent on or shares parameters with another model which is not included.

The solution to this is include each of these models as arguments in another MxModel object which is passed to mxRun()