I'm trying to build a simple auto-lagged model for some simulated data. The observations are simple ar(1) with 6 observations per subject and where the time points are irregular within and between subjecs. Eid in the Daily Life handbook (pp. 398-402) shows how to do this in MPlus.
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.