You are here

Revision of mxConstraint-help from Fri, 08/20/2010 - 17:38

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Wiki home page

Constraints

To add a constraint to a model, simply call

mxConstraint(expression, name = NA)
where expression is an R expression of matrix operators and matrix functions.
and name is an optional character string. e.g.

   mxConstraint(ma ==mf, name = "ma_equate_ma_and_mf)

The mxConstraint function defines relationships between two MxAlgebra or MxMatrix objects. They are used to affect the estimation of free parameters in the referenced objects. The constraint relation is written identically to how a MxAlgebra expression would be written.
The outermost operator in this relation must be either ‘<’, ‘==’ or ‘>’. To affect an estimation or optimization, an MxConstraint object must be included in an MxModel object containing all referenced MxAlgebra and MxMatrix objects.

Note: The mxConstraint function should not be used to constrain free parameters, either by name or by their position in an MxMatrix or MxAlgebra object. Free parameters in the same MxModel are constrained to equality by giving them the same label in their respective 'labels' matrices.