New Feature in trunk: mxExpect and mxFit functions

Ryne's picture

OpenMx has a new feature for beta testing available in the trunk for users who build OpenMx from source. This feature is not included in the current (1.3.1) binary release, but will be available in an upcoming beta release.

OpenMx is changing the way that objective functions are specified. Currently, we have a number of different types of objective functions. Some of them deal entirely with how models are fit, but require the user to specify the expected model on their own. MxMLObjective and mxFIMLObjective are examples of this type of objective function. Alternatively, other objective functions are concerned with how a model's expectation is created, with little control over how the model is fit. For example, mxRAMObjective turns a series of path statements or A, S and M matrices into an expected model, but actually calls one of the maximum likelihood objectives to fit the model. This two-tiered set of objective functions has only worked thus far because maximum likelihood is the only way to specify models without users writing their own algebras. However, the OpenMx development team is currently implementing other ways of fitting models that makes this two-tiered approach untenable in the long term.

To deal with this problem, an upcoming release of OpenMx will split objective functions into two related functions: expectation functions and fit functions. Model expectations will be specified using functions that begin with "mxExpect", and will include not just RAM, but LISREL and normal theory expectations as well. Fit functions will be specified using functions that begin with "mxFit", and include maximum likelihood, weighted and unweighted least squares and user-specified fit functions. This split will not only allow for pathic specification using non-ML fit functions, but make it easier for users to specify models using model types, expectations and fit functions currently being implemented. The expectation-fit feature will also give you more freedom to specify models in any way you see fit.

It is important to note that while MxObjective objects are disappearing, current mxObjective functions are not. These functions will now output the expectation and fit functions implied by the old objective function.

Below is a list of the features of this split as is currently implemented in the trunk: additional features, details and documentation are all forthcoming.

  • Just as objective functions were named "model.objective", fit functions are named "model.fitfunction" and expectation functions are named "model.expectation".
  • All of the information that was stored in objective@info is now stored in fitfunction@info
  • To assist in the transition from objective functions to fit and expectation functions:
    • All of the functions of the form mxFooObjective() now return a list containing 1 fit function object and either 0 or 1 expectation function objects.
    • model[["objective"]] will return a list of the expectation function and the fit function
    • Inside an algebra or mxEval(), all references to "objective" are automatically converted to "fitfunction". For example, mxAlgebra(MZ.objective + DZ.objective, name = "sumAlgebra") will be interpreted as mxAlgebra(MZ.fitfunction + DZ.fitfunction, name =
      "sumAlgebra")

There's still a lot of work to be done on this feature, and we're happy to hear your comments.