The mxAlgebra function is used to create algebraic expressions that operate on one or more
MxMatrix objects. To evaluate an MxAlgebra object,
it must be placed in an MxModel object, along with all referenced MxMatrix
objects and the mxFitFunctionAlgebra function.
The mxFitFunctionAlgebra function must reference by name the MxAlgebra object to be evaluated.Note that, if the result for an MxAlgebra depends upon one or more "definition variables" (see mxMatrix()), then the value returned after the call to mxRun() will be computed using the values of those definition variables in the first (i.e., first before any automated sorting is done) row of the raw dataset.
The following operators and functions are supported in mxAlgebra:
Operators
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Functions
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
There are also several multiargument functions usable in MxAlgebras, which apply themselves elementwise to the matrix provided as their first argument. These functions have slightly different usage from their Rcounterparts. Their result is always a matrix with the same dimensions as that provided for their first argument. Values must be provided for ALL arguments of these functions, in order. Provide zeroes as logical values of FALSE, and non-zero numerical values as logical values of TRUE. For most of these functions, OpenMx cycles over values of arguments other than the first, by column (i.e., in column-major order), to the length of the first argument. Notable exceptions are the log, log.p, and lower.tail arguments to probability-distribution-related functions, for which only the [1,1] element is used. It is recommended that all arguments after the first be either (1) scalars, or (2) matrices with the same dimensions as the first argument.
ccl{
Function Arguments Notes
dbeta x,shape1,shape2,ncp,log The algorithm for the non-central beta distribution is used for non-negative values of ncp. Negative ncp values are ignored, and the algorithm for the central beta distribution is used.
pbeta x,shape1,shape2,ncp,lower.tail,log.p Values of ncp are handled as with dbeta().
besselJ & besselY x,nu
besselI & besselK x,nu,expon.scaled Note that OpenMx does cycle over the elements of expon.scaled.
}