Dear readers,
I am trying to specify an RI-CLPM in OpenMx. However, if I constrain the variance of the observed indicators to zero, the model implied covariance matrix is not positive definite - but these variances are supposed to be zero, as they are partialized into a time-invariant component and a time-variant component. E.g., the variance x1 <-> x1 should be split up into RIx <-> RIx and cx1 <-> cx1.
Can anyone help me correctly specify this model in OpenMx?
df <- data.frame(matrix(rnorm(500*8), ncol = 8)) names(df) <- paste0(rep(c("x", "y"), each = 4), 1:4) xobs <- grep("^x", names(df), value = TRUE) yobs <- grep("^y", names(df), value = TRUE) xvars <- paste0("c", grep("^x", names(df), value = TRUE)) yvars <- paste0("c", grep("^y", names(df), value = TRUE)) xminone <- xvars[-1] xminend <- xvars[-length(xvars)] yminone <- yvars[-1] yminend <- yvars[-length(yvars)] riclpm<-mxModel("riclpm", type="RAM", manifestVars=c(xobs, yobs), latentVars = c("RIx", "RIy", xvars, yvars), mxData(observed=df, type="raw"), mxPath(from="RIx", to=xobs, arrows=1, free=FALSE, values=1), mxPath(from="RIy", to=yobs, arrows=1, free=FALSE, values=1), mxPath(from=xvars, to=xobs, arrows=1, free=FALSE, values=1), mxPath(from=yvars, to=yobs, arrows=1, free=FALSE, values=1), # RI cors mxPath(from="RIy", to="RIx", arrows=2, free=TRUE, values=0), mxPath(from=c("RIy", "RIx"), arrows=2, free=TRUE, values=0), mxPath(from=xminend, to=xminone, arrows=1, free=TRUE, values=c(.1), labels="x_x"), mxPath(from=yminend, to=yminone, arrows=1, free=TRUE, values=c(.1), labels="y_y"), mxPath(from=xminend, to=yminone, arrows=1, free=TRUE, values=c(.1), labels="y_x"), mxPath(from=yminend, to=xminone, arrows=1, free=TRUE, values=c(.1), labels="x_y"), # Vars mxPath(from=xvars[1], arrows=2, free=TRUE, values=c(.1), labels = "vx1"), mxPath(from=yvars[1], arrows=2, free=TRUE, values=c(.1), labels = "vy1"), mxPath(from=xminone, arrows=2, free=TRUE, values=c(.1), labels = "vx"), mxPath(from=yminone, arrows=2, free=TRUE, values=c(.1), labels = "vy"), #mxPath(from=c(xobs, yobs), arrows=2, free=TRUE, values=c(.1)), mxPath(from=c(xobs, yobs), arrows=2, free=FALSE, values=0), # Covars mxPath(from=xvars[1], to = yvars[1], arrows=2, free=TRUE, values=0, labels = "rxy1"), mxPath(from=xminone, to = yminone, arrows=2, free=TRUE, values=0, labels = "rxy"), mxPath(from = 'one', to = c(xvars, yvars)) ) res <- mxRun(riclpm)