implement [] in mxAlgebra/mxConstraint
[ (the bracket accessor function) is not listed as an implemented function in mxAlgebra.
It's handy, but not available in algebra or the algebra of a constraint:
# ======================================
# = 1. Try bracket access in mxAlgebra =
# ======================================
nOrd = 3
nVar = 5
fit1 = mxModel("fit1",
mxMatrix(name="a" , "Full", nrow=nVar, ncol=nVar, free=T, values=1:25),
mxMatrix(name="unit", "Unit", nrow=nOrd, ncol=1),
mxAlgebra(diag2vec(a)[1:3], name = "ordElements"),
mxConstraint(name = "con1", ordElements == unit),
- Read more about implement [] in mxAlgebra/mxConstraint
- 6 comments
- Log in or register to post comments