matrix redimensioning
Posted on

Forums
We've had a request for a function that changes the dimensions of a matrix.
Maybe mxRedim(mat, row, col)
? Conformance would require that the total number of elements remain constant. That is, mat->rows * mat->cols == row * col
.
Semantics would probably fill in by columns.
Not sure what the utility of
genEpi_Redim(mxMatrix, newRows, newCols)
Can anyone say why it is helpful?
Log in or register to post comments
In reply to Not sure what the utility of by tbates
Yes, suppose you wish to fit
Log in or register to post comments
In reply to Yes, suppose you wish to fit by neale
Given the nature of R's
This would place the 2x2 matrix A into the submatrix [2:3,2:3] of matrix B. This makes sense from an R-ish perspective, but I'm not so sure that it could be implemented without a lot of hackery.
All of this argues for a style of model building where you create your mxMatrix pieces ahead of time. Lately I've been experimenting with this style to see how it works. It tends to look something like this in practice:
This is an example of the specification of an A matrix that is entirely independent of how many factors and indicators in a fully cross-loaded factor model. This is currently easier in path-style, but sometimes one needs to use matrices.
The advantage is that I can change just about anything and the just pump it into a new mxMatrix of any order. The disadvantage is having to keep track of the three sets of component matrices in the mxMatrix.
Log in or register to post comments