I have just got this error message. What I have done is
- define a model say, A, which includes sub-models.
- define A0<-mxModel(A, name="A0")
- add a suffix "0" to all parameters in A0, so that A and A0 are exactly the same but with independent parameters
- define a bigger model M<-mxModel("M", A, A0, some constraints and objective function over A and A0)
When I ran it, OpenMx complains that the name of a submodel in A appears more than once. Do sub-sub-models need to have different names even though they are in different sub-models? If this is required, is there a better way to do 1-4 above without defining A0 from scratch?
Thanks a lot.
Hao
Yes, all named entities in a model must have unique names. Take a look at the function
mxRename()
, it may be sufficient for your script.Thanks, Mike. That helps.
Actually it turns out that I only need to rename some of the duplicated objects, but not all of them, for the model to run. Would this be normal or unexpected? Would it be possible to make mxRename() rename multiple objects at a time? Currently it can only rename a single object.
Thanks.