Error in omxAssignFirstParameters / omxSetParameters... 'labels' argument must not contain duplicate values

Posted on
No user picture. CharlesD Joined: 04/30/2013

This seems to be occurring when I try and constrain values across different matrices by label, then use omxAssignFirstParameters to set starting values - omxSetParameters gives the " 'labels' must not contain duplicate values" error. When I use the same label within the same matrix there is no problem. When browsing into the error, I see that indeed, the labels object within omxSetParameters contains duplicates only when they are specified from different matrices.

Replied on Fri, 12/12/2014 - 09:41
Picture of user. jpritikin Joined: 05/23/2012

This should be easy to fix.

Which version of OpenMx are you using? Is this subversion trunk or 2.0 release?

Do you have code that you can share to easily reproduce this problem?

Replied on Sat, 12/13/2014 - 12:20
No user picture. CharlesD Joined: 04/30/2013

Sorry, I should get better at the bug report thing :)
Using the recent release, 2.0.0-0, on 64 bit windows pc's, the following code will show the failure:

test<-matrix(rnorm(100,0,1),ncol=2)
colnames(test)<-c('v1','v2')
testm<-mxModel(type='RAM',
mxData(test,type='raw'),
mxMatrix(name='A',ncol=2,nrow=2),
mxMatrix(name='S',ncol=2,nrow=2,labels=c('freematrix1[1,1]',NA,NA,'freematrix2[1,1]')),
mxMatrix(name='freematrix1',values=3,free=T,nrow=1,ncol=1,labels='freeparam1'),
mxMatrix(name='freematrix2',values=2,free=T,nrow=1,ncol=1,labels='freeparam1'),
mxMatrix(name='M',ncol=2,nrow=1),
mxMatrix(name='F',type='Diag',,values=1,ncol=2,nrow=2,dimnames=list(c('v1','v2'),c('v1','v2'))),
mxExpectationRAM(M='M',dimnames=c('v1','v2')),
mxFitFunctionML()
)
testm<-omxAssignFirstParameters(testm)
fit<-mxRun(testm)
summary(fit)

Replied on Sat, 12/13/2014 - 16:26
Picture of user. mhunter Joined: 07/31/2009

In reply to by jpritikin

Add this test to models/passing/startingValues.R please. Prevent future issues.