mxRowObjective() interface

To eliminate NA values in definition variables, the mxRowObjective() function will contain two additional MxMatrix objects. "filteredDataRow" is a row vector that contains all the non-NA values in each row of a full information calculation. "filteredDataRow" may change size for each row of the calculation. "existenceVector" is a fixed length vector of 1.0s and 0.0s that contains 0.0 iff the data set contains an NA value for that specific row and column. "existenceVector" can be used to filter the expected covariance matrix. We will provide several selection functions that can be combined with "existenceVector" to do the filtering. Can't use the [] operator to perform the filtering because OpenMx does not support logical types only numeric types.
At the conclusion of the dev meeting, it was decided that the new signature of mxRowObjective() would be the following:
mxRowObjective <- function(rowAlgebra, dimnames, rowResults = NA, filteredDataRow = NA,
existenceVector = NA, reduceAlgebra = NA)
"rowResults", "filteredDataRow", and "existenceVector" are MxMatrix objects that are created by the call to mxRun() and a specific names can be assigned to them. "reduceAlgebra" is entirely optional. One alternative would be to require fixed names for the three arguments.
Here is a compromise alternative. A default name for the three arguments is provided, but can be overwritten by the user:
mxRowObjective <- function(rowAlgebra, dimnames, rowResults = "rowResults", filteredDataRow
= "filteredDataRow", existenceVector = "existenceVector", reduceAlgebra = NA)
I've changed the signature of
mxRowObjective <- function(rowAlgebra, reduceAlgebra, dimnames, rowResults = "rowResults",
filteredDataRow = "filteredDataRow", existenceVector = "existenceVector")
Otherwise it is way too easy to leave off the reduceAlgebra from the objective function, and insert a reduceAlgebra into your model that is silently ignored. Our test case for the row objective function now looks like this (it doesn't handle missing data yet):
If your row objective function will not perform a reductive step, then insert the algebra
mxAlgebra(rowResults, name = "reduceAlgebra")
into your model.Log in or register to post comments