The name XXX appears more than once in the model

2 replies [Last post]
wuhao_osu's picture
Joined: 09/07/2010

I have just got this error message. What I have done is

1. define a model say, A, which includes sub-models.
2. define A0<-mxModel(A, name="A0")
3. add a suffix "0" to all parameters in A0, so that A and A0 are exactly the same but with independent parameters
4. 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.


mspiegel's picture
Joined: 07/31/2009
Yes, all named entities in a

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.

wuhao_osu's picture
Joined: 09/07/2010
rename multiple objects at one time?

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.