mxAlgebraObjective {OpenMx} | R Documentation |

WARNING: Objective functions have been deprecated as of OpenMx 2.0.

Please use MxFitFunctionAlgebra() instead. As a temporary workaround, MxAlgebraObjective returns a list containing a NULL MxExpectation object and an MxFitFunctionAlgebra object.

All occurrences of

mxAlgebraObjective(algebra, numObs = NA, numStats = NA)

Should be changed to

mxFitFunctionAlgebra(algebra, numObs = NA, numStats = NA)

`algebra` |
A character string indicating the name of an MxAlgebra or MxMatrix object to use for optimization. |

`numObs` |
(optional) An adjustment to the total number of observations in the model. |

`numStats` |
(optional) An adjustment to the total number of observed statistics in the model. |

NOTE: THIS DESCRIPTION IS DEPRECATED. Please change to using mxFitFunctionAlgebra as shown in the example below.

Fit functions are functions for which free parameter values are chosen such that the value of the objective function is minimized. While the other fit functions in OpenMx require an expectation function for the model, the `mxAlgebraObjective`

function uses the referenced `MxAlgebra`

or `MxMatrix`

object as the function to be minimized.

If a model's primary objective function is a `mxAlgebraObjective`

objective function, then the referenced algebra in the objective function must return a 1 x 1 matrix (when using OpenMx's default optimizer). There is no restriction on the dimensions of an objective function that is not the primary, or ‘topmost’, objective function.

To evaluate an algebra objective function, place the following objects in a `MxModel`

object: a `MxAlgebraObjective`

, `MxAlgebra`

and `MxMatrix`

entities referenced by the `MxAlgebraObjective`

, and optional `MxBounds`

and `MxConstraint`

entities. This model may then be evaluated using the `mxRun`

function. The results of the optimization may be obtained using the `mxEval`

function on the name of the `MxAlgebra`

, after the model has been run.

Returns a list containing a NULL MxExpectation object and an MxFitFunctionAlgebra object. MxFitFunctionAlgebra objects should be included with models with referenced `MxAlgebra`

and `MxMatrix`

objects.

The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation.

mxAlgebra to create an algebra suitable as a reference function to be minimized. More information about the OpenMx package may be found here.

# Create and fit a very simple model that adds two numbers using mxFitFunctionAlgebra library(OpenMx) # Create a matrix 'A' with no free parameters A <- mxMatrix('Full', nrow = 1, ncol = 1, values = 1, name = 'A') # Create an algebra 'B', which defines the expression A + A B <- mxAlgebra(A + A, name = 'B') # Define the objective function for algebra 'B' objective <- mxFitFunctionAlgebra('B') # Place the algebra, its associated matrix and # its objective function in a model tmpModel <- mxModel(model="Addition", A, B, objective) # Evalulate the algebra tmpModelOut <- mxRun(tmpModel) # View the results tmpModelOut$output$minimum

[Package *OpenMx* version 2.1.0 Index]