You are here

Add option to change name of a model when you omxSetParameters it

Usually, one uses omxSetParameters() to change something about a model - say fix or free parameters, so that the revised model can be fitted and compared. It would be useful to be able to change the name at that point. The attached patch modifies omxSetParameters() to add at the end of the arglist newname = NULL and if the newname is not NULL it changes the model name.

Possibly, newModelName would be a better name for the new argument, from the disambiguation pov. That does, however, apply in other places... name = is also a possibility but would be even more ambiguous.

AttachmentSize
File mxModelParameters.patch864 bytes
Reporter: 
Created: 
Sun, 02/19/2012 - 20:32
Updated: 
Thu, 08/22/2013 - 14:04

Comments

Uh, we already have a function to do this: mxRename().

Yes, but that makes it a two-liner instead of a one-liner. Pretty much whenever one uses omxSetParameters one does so in order to fit a different model, and renaming helps later on.

From a didactic perspective, one command to effect all the necessary changes in a model seems easier to communicate.

Good to be reminded about mxRename() nonetheless; might simplify the proposed revision to omxSetParameters

OK, the argument 'name=' has been added to omxSetParameters() in the svn trunk. I could include it in the stable-1.2 series, so it would be a part of OpenMx 1.2.1. That slightly goes against our policy of minor releases reserved for bug fixes (unless you count this missing feature as a bug), but OTOH the change is so small it should be OK.

I think if we're doing this, it may as well go out now, to minimise the number of scripts that don't take advantage of halving the number of lines updating takes.

I wrote a wrapper just to do this, and it would be good to retire it :-)

OK it's been ported to the 1.2 code base.

Automatically closed -- issue fixed for 2 weeks with no activity.