You are here

Error: A cycle has been detected in model

1 post / 0 new
tbates's picture
Offline
Joined: 07/31/2009 - 14:25
Error: A cycle has been detected in model

If you create a multi-group model by simply embedding the group models in a container, be sure an add an explicit model name or put the fit function first. Otherwise mxModel will interpret the first parameter as a base model to update, and adding the multigroup function will cause a "cycle" - a reference that resolves back to itself.

works:

myModel = mxModel("twoGroups", m1, m2, mxFitFunctionMultigroup(c("female", "male")))

Fails:

myModel = mxModel(m1, m2, mxFitFunctionMultigroup(c("female", "male")))
Error: A cycle has been detected in model 'female' involving the following elements: ‘fitfunction’