mxMatrix() proposed changes

nrow
' and 'ncol
' arguments. This proposed is based on the following bug report: http://openmx.psyc.virginia.edu/issue/2010/07/matrix-not-populated-expected-r-based-nrow-ncol
Current behavior: if any of the arguments 'values
', 'labels
', 'free
', 'fixed
', 'lbound
', or 'ubound
' are matrices, then the arguments 'nrow
' and 'ncol
' are ignored. A warning is issued informing the user that the 'nrow' and 'ncol' arguments are ignored. All the matrices of the MxMatrix
object will end up with dimensions equal to the dimensions of the matrix that was passed.
Proposed behavior: if the values of 'nrow
' and 'ncol
' are specified, then they supersede the dimensions of any of the matrices passed into 'values
', 'labels
', 'free
', 'fixed
', 'lbound
', or 'ubound
'. All the matrices of the MxMatrix
object will end up with dimensions equal to 'nrow
' and 'ncol
'. A warning is issued if the data length is not a sub-multiple or multiple of the numbers of rows/cols.
PROs: mxMatrix() will mimic the behavior of matrix() with respect to the 'nrow
' and 'ncol
' arguments.
CONs: no warning is issued if 'values
', 'labels
', 'free
', 'fixed
', 'lbound
', or 'ubound
' are of different dimensions, but are sub-multiples or multiples of the numbers of rows/cols.
I think this makes sense, and
Another con is that some (probably very few) scripts' behavior may be changed, so I recommend that the documentation of mxMatrix notes that behavior has changed as of version x.x.xx.
Log in or register to post comments
I agree that the proposed
However, some people may have begun to rely on the previous behavior. This one is tricky and so I'd throw a warning at least for a few revs so that one can be alerted to the fact that argument precedence has changed.
Log in or register to post comments
In reply to I agree that the proposed by Steve
Makes sense if nrow and ncol
My only comment would be that IF the user omits the nrow and ncol arguments, then a matrix provided for values or other layers of the mxMatrix datatype should be used to generate the mxMatrix dimensions.
Best of both worlds?
Log in or register to post comments
OK, I checked in the changes
Log in or register to post comments