## constraint on algebra result

2 replies [Last post]
Offline
Joined: 01/06/2010

Dear all,

I would like to add a constraint in my EFA model to ensure that Z is diagonal. Z is a function of other matrices. I used an mxConstraint, where J is a conformable identity matrix. My question is, do you see a way of specifying this using labels instead of an mxConstraint?

algebraZ = mxAlgebra(expression = t(L)%*%G%*%solve(F), name = "Z") # should be diag

constraint1 = mxConstraint(Z == J*Z, name = "oblique")

Thanks in advance, I can give my full code if needed.

Suzanne

Offline
Joined: 07/31/2009
I'm afraid you can't

I'm afraid you can't constrain the result of an algebra in this way, and your next steps depend on how and why you want this constraint. If you want to just ignore off-diagonal elements if they are non-zero, you could do some square bracket substitution to make a new matrix (Z2), fix all of the non-diagonal elements to zero, and assign labels to all of the diagonal elements as "Z[1,1]", "Z[2,2]", etc. I wouldn't think this is what you would want to do in an EFA, but I don't know what this Z matrix is trying to represent.

ryne

Offline
Joined: 07/31/2009
I don't see one with labels.

About the only help I can offer is to note that if t(L)%*%G%*%solve(F) is symmetric, it would be more efficient to use vech(Z) == vech(J*Z), and now I think about it, it would be better to get rid of the diagonal since those constraints are always satisfied. This you might achieve by pre- and post-multiplication by matrices of the form cbind(zero,identity) where zero is a vector of zeroes and identity is an identity matrix of size one less than the order of Z, and followed with vec() or vech() operators.