-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mxPath: Adding undirected effect removes directed effect #375
Comments
That is possibly by design, although the paths would not overwrite each other (one goes in A and the other in the S matrix), so I think the restriction should be removed (other dev team members may disagree so we will discuss). If you need a workaround, then you can add latent variables that cause the observed variables with paths equal to 1, give them variances of 1, and estimate their covariance instead while retaining the causal path from x1 to x2. |
Thanks for the quick reply! I also think that adding both types of effects on the same variables is a rare situation and most likely a user error. However, we wanted to implement a model from Gische & Voelkle, 2022 where there are both directed and undirected effects between repeatedly measured variables. As the autoregressive and cross-lagged effects in this model are constrained to be equal over time, the model should also allow the estimation of covariances. |
Here's another possible workaround: directly modify the 'A' or 'S' MxMatrices. For example, if you already have the undirected path in your model, you can add the directed one like this:
You can likewise modify the 'values' matrix of 'S' or 'A' to set start values. Also, remember that 'S' is symmetric, so if you modify an off-diagonal element of 'S', you have to likewise modify the corresponding element on the other side of the diagonal. |
Thank you! The workarounds work perfectly! |
… of heterogeneity = "homogeneous" (OpenMx/OpenMx#375)
If you discuss this, plus 1 for removing the restriction in the next release: It surprises users when OpenMx silently deletes paths from their model, and as @mcneale notes, having both
|
I'm inclined to agree that OpenMx's current behavior is not what's best, and that the restriction should be removed. |
Hi,
I've been experimenting with the
mxPath()
function lately, and have come across a problem that is probably an edge case. Adding both a directed effect and an undirected effect for the same observed variable does not seem to work. The effect added first is removed from the model.Best,
Jannik
The text was updated successfully, but these errors were encountered: