Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *mspiegel*

Created *12/11/2009 - 15:41*

Fri, 12/11/2009 - 15:41 — mspiegel [1]

This proposal is for a new objective function that allows for a generic row-by-row computation on a data-set, followed by a final computation to aggregate all the row-by-row results. The objective function takes four arguments.

mxRowObjective(rowAlgebra, rowResults = NA, reduceAlgebra = NA, name = NA).

All four arguments expect character vector (string) values. rowAlgebra is the name of a MxMatrix algebra in the model. This algebra is applied to each row in a model. The result of the rowAlgebra must be a (1 x m) matrix. The results of the rowAlgebra computations are collected into a (n x m) matrix that will be named with the 2nd argument. n in this case is the number of rows in the data matrix. If reduceAlgebra is NA, then the return value of the objective function is the rowResults matrix. Otherwise, execute the reduceAlgebra and return the value of that algebra.

**Links:**

[1] http://openmx.psyc.virginia.edu/users/mspiegel

[2] http://openmx.psyc.virginia.edu/thread/362

[3] http://openmx.psyc.virginia.edu/forums/openmx-developer-forums/new-feature-proposals