You are here

Code 6

8 posts / 0 new
Last post
milana.smolkina's picture
Offline
Joined: 02/22/2016 - 12:37
Code 6

Hi everyone,

During the workshop you introduced the mxTryHard() command instead of mxRun(), which I read
can be useful when mxRun() returns a code 6.

I am running a bivariate saturated model with binary data. The main saturated model I run seems to run better, but when I use mxTryHard() for sub-models the messages look like this:

Begin fit attempt 1 of at maximum 11 tries
Lowest minimum so far: 3159.84949759196
OpenMx status code 6 not in list of acceptable status codes, 0
OpenMx status code 6 not in list of acceptable status codes, 0
Not all eigenvalues of Hessian are greater than 0: 857539769.124727, 779.642587546502, 519.066582133804, 435.512846233224, 323.277652451376, 272.947636007993, 231.580861937549, 199.287427329626, 182.359108855876, 173.067247762125, 130.141272120151, 102.045389085597, 98.4601557344951, -4511164.96705233

New attempts then either return code 6s or "fit attempt generated errors".

Each time I re-run the model like this, I get different -2LL and p-values, when I compare models. I am not sure how to react to these error messages and the fact that estimates change from run to run. Also, I don't know what this tells me about my data.

Any guidance would be appreciated!

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
Concerning status code 6

Concerning status code 6 generally, see my answer to Question 11 from Friday at the Workshop here. Note that with threshold data, it's possible to get status code 6 even when the optimizer HAS found a minimum.

In your case specifically...

  • Make sure the model is identified.
  • Are you using NPSOL as the default optimizer? Try SLSQP or CSOLNP instead.
  • Try mxTryHardOrdinal() instead of mxTryHard(); it has default argument values intended specifically for threshold data.
  • Maybe, change some mxOptions. I don't work with threshold data often enough to be able to give you specific guidance about doing that, though.

Without seeing the script you're using, I can't really suggest anything further.

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
mxTryHardOrdinal()

As I recently mentioned in a different thread, with ordinal data, you should be using mxTryHardOrdinal() instead of mxTryHard(), or at least, use mxTryHard() with argument finetuneGradient=FALSE.

milana.smolkina's picture
Offline
Joined: 02/22/2016 - 12:37
Thank you! This has helped!

Thank you! This has helped!

neale's picture
Offline
Joined: 07/31/2009 - 15:14
Try tweaking integration parameters

In this thread, use of the precision parameters for numerical integration is described.
http://openmx.psyc.virginia.edu/thread/3868
However, I would note that code 6 is very common with ordinal data problems, even after try hard. Usually the solution IS a global minimum, or extremely close to it, but the precision isn't quite there for the optimizer to declare happiness with the solution.

That said, we are exploring alternatives to FIML analysis as currently implemented. You may want to check out the weighted least squares approaches now available, or wait to see what the next 6 months of development bring ;).

milana.smolkina's picture
Offline
Joined: 02/22/2016 - 12:37
Thank you!!

Thank you!!

yenni's picture
Offline
Joined: 10/08/2013 - 18:08
code 6

Hello all
when I want to fit my model, I receive this warning message:

In model 'group1' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found during the final linesearch (Mx status RED)

I would be really happy, if someone helped me.

thanks
yenni

File attachments: 
neale's picture
Offline
Joined: 07/31/2009 - 15:14
mxTryHard

I think the optimizer has found a minimum here - the standard errors look ok although there is a warning. I suggest that you use mxTryHard() instead of mxRun() [edit - you already did so ignore this]. Possibly the starting values are quite poor with mxTryHard() at its default argument settings - the value for scale for example might be reduced. It is worth noting that the status code 6 can emerge with continuous data analyses (as is the case here) as well as with ordinal data analyses. mxTryHard would have a better chance of making it go away.

A hint to help you code:

manifestVars<-paste0("V",1:16)

HTH