Hi chaps,
I was incorporating mxConstraint() into a model today and getting the following error
I was incorporating mxConstraint() into a model today and getting the following error
mxRun(model) Running common_path_constraint_ACE Error in mxRun(model) : Non-conformable matrices in Matrix Subtract.
The actual problem is that I was equating a 2*2 Identity to a 1*1 Full, so the error is misleading...
Would be nice if the error contained the matrix names (i.e., L and nFac_IMatrix) and mxConstraint rather than subtraction
Here's a fragment to show the usage...
share = mxModel("all",
mxMatrix("Full", nrow=1, ncol=1, free=TRUE, values=.6, name="a_l"),
mxMatrix("Full", nrow=1, ncol=1, free=TRUE, values=.6, name="c_l"),
mxMatrix("Full", nrow=1, ncol=1, free=TRUE, values=.6, name="e_l"),
mxAlgebra(a_l %*% t(a_l) + c_l %*% t(c_l) + e_l %*% t(e_l) , name="L"), # latent factor variance
mxMatrix("Iden", nrow=2, free=FALSE, name="nFac_IMatrix"),
mxConstraint("L", "=", "nFac_IMatrix", name = "constraint1")
)
#1
Log in or register to post comments
#2
Log in or register to post comments