@output$status Codes

3 replies [Last post]
pdeboeck's picture
Offline
Joined: 08/04/2009

Hi --- I was just curious if there is documentation regarding the codes in @output$status. I've been looking at [[1]], and think I have figured out the values for Code Red (6) and Green (1), but now I'm also producing values of -1 and 4. I was also curious what the values in [[2]] and [[3]] tell me, and the associated codes.

tbrick's picture
Offline
Joined: 07/31/2009
@output$status[[1]] is the

@output$status[[1]] is the status returned by the optimizer, in this case NPSOL. Error code -1 means that the optimizer found itself stuck in a location where the objective function could not be calculated, and could not find a way out. This most often happens if the starting values make the calculation impossible.

In that case, output$status[[2]] returns the error code from OpenMx, which is usually -1. -1 indicates that some aspect of the objective calculation could not be completed at the current location. output$status[[3]] should tell you why the objective function could not be calculated (for example, "Covariance matrix is non-positive-definite...").

NPSOL output 4 means that the iteration limit was reached, with no solution found. You can use MxOptions() to set a higher iteration limit, or just run MxRun again on the model containing output--it'll start from the most recent set of estimates, and make another run of the same number of iterations.

For reference, NPSOL status codes 2 and 3 mean that the bounds and constraints, respectively, could not be satisfied. If you get any other status codes, they likely indicate a bug in the back-end, and should be reported.

Each of the output codes should report the appropriate error message at the end of evaluation of the MxRun() statement.

pdeboeck's picture
Offline
Joined: 08/04/2009
Regarding your last

Regarding your last statement: The errors do come up when running one model at a time. However, as I'm running a few million models, I just extract that status codes. The -1 and 4 codes occurred less frequently, hence why I had problems recreating those events.

Thanks for the help!

mspiegel's picture
Offline
Joined: 07/31/2009
I think a value of -1

I think a value of -1 indicates an error in the backend that happened outside of NPSOL. Try running the same model in the 0.1.4 release. I think we started reporting the backend error messages in R (hooray), so you should see some kind of error appear when you run the model. I don't know what a value of 4 indicates.