Definition Variables in Constraints and Confidence Intervals

The model works fine with equally spaced time points - I can get back the ar(1) value used in the simulation.
To handle unequal spacing, I'm using definition variables. The trick is to constrain the ar loadings. Suppose you have (a simple path diagram):
x1 --> x2 --> x3 --> x4 --> x5 --> x6
The loading for the path from 1 to 2 has parameter p1, from 2 to 3, p2 etc. The lag length for the paths are the differences between the time points (i.e., lag2_1 = t2 - t1, lag3_2 = t3 - t2, where t1 is the first time point, etc.). You constrain as follows:
p1 = beta^(lag2_1)
p2 = beta^(lag3_2)
p3 = beta^(lag4_3)
and so on. I implemented this with mxConstraint's and mxAlgebra's. I get no error messages and no warnings but the results are not right - at least the estimate of beta is not near to the ar(1) used in the simulation. In my simulation with irregular spacing, the average difference between t2 and t1 is about 2 units (about the same fro t3 and t2, etc.). If I take the estimated p1, p2, etc, and square root them (i.e., raise to the power of 1 over the average lag which is approximately equal to 2), then I seem to get values near to the ar(1) used in the simulation.
I can't get OpenMx to compute the average lags across subjects - it seems to just print the difference betweenlast individual value of the definition variables.
How can I correctly implement this model?
GIven the contraints are nonlinear, is it still possible to get likelihood confidence intervals? The intervals I get have lower bounds higher than the estimate.
Sub-Models
Log in or register to post comments
In reply to Sub-Models by rabil
If I understand the problem
mxMatrix(values=0.5, labels="betalab", free=TRUE, nrow=1, ncol=1, name="beta")
mxAlgebra(beta^data.lag2_1, name="p1")
mxAlgebra(beta^data.lag3_2, name="p2")
mxAlgebra(beta^data.lag4_3, name="p3")
The "beta" in each mxAlgebra() is automatically the same because things with the same name are automatically identical in OpenMx. It's possible that the free parameter label could/should be used instead of the name of the 1x1 matrix, or that elementwise powering should be used, but the above should do what you described.
If this is not what you asked, then let us know!
Log in or register to post comments
In reply to If I understand the problem by mhunter
Thanks. This is exactly what
Log in or register to post comments
In reply to Thanks. This is exactly what by rabil
Great! Glad to help. The use
The use of mxConstraint can be confusing. For me, the name "constraint" does not help. It's best used for non-linear inequality constraints. Many linear and/or equality constraints can be achieved with bounds and algebras.
Log in or register to post comments