Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *manu*

Created *03/17/2010 - 07:52*

Wed, 03/17/2010 - 07:52 — manu [1]

Dear all,

sorry for this simple question. What I want to do is to impose a simple parameter constraint. If I want to set two parameters equal, I simply use the same label. However, what if I want to set parameter a = 2*b, so that actually only one parameter is freely estimated?

After searching the archives, the only cumbersome way I came up with is to define two new matrices with a single element but new names, use the mxAlgebra function to multiply by two and then use the mxConstraint function to set the matrices equal. So I did something like that

mxMatrix(type = "Full", nrow=1, ncol=1, free=F, values = 0, label="a", name="con_a"),

mxMatrix(type = "Full", nrow=1, ncol=1, free=T, values = 1, label="b", name="con_b"),

mxAlgebra(expression= 2*con_b, name="con"),

mxConstraint("con", "=", "con_a"),

But then something goes wrong, and I am not sure why. Do I have to define the elements of both matrices as free? fixed? Is not there a simpler way? This seems overly complicated.

Thank you very much!

**Links:**

[1] http://openmx.psyc.virginia.edu/users/manu

[2] http://openmx.psyc.virginia.edu/thread/632

[3] http://openmx.psyc.virginia.edu/thread/617

[4] http://openmx.psyc.virginia.edu/forums/openmx-help/openmx-general-help