Difference between revisions of "OpenMx Example Scripts"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
'''[[Linear Growth Model in One Twin Sample]]''' | '''[[Linear Growth Model in One Twin Sample]]''' | ||
+ | |||
+ | == OpenMx Optimizer Codes == | ||
+ | |||
+ | These descriptions are from Mike Neale at [https://openmx.ssri.psu.edu/thread/326] | ||
+ | |||
+ | * A value of −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. Estimates from runs with output$status[[1]] equal to -1 can never be trusted, and the job must be re-run with different starting values, or a corrected model specification. | ||
+ | |||
+ | * A value of 6 means that optimality conditions could not be reached, and the optimizer could find no way to improve the estimate. It often implies either a mistake in the model specification or starting values in an intractable range. The estimates resulting from this run are often NOT optimal estimates, and should not be treated as solutions, so this code is labeled (Mx status RED). The job should be re-run, either from the final solution, or from new starting values, or both. If multiple different starting values converge on the same solution (same parameter estimates and fit function) then confidence that the minimum has been found increases. | ||
+ | |||
+ | The following descriptions are from that same thread. They are less useful. | ||
+ | |||
+ | * A value of 0 means a successful optimization--no error returned. | ||
+ | * A value of 1 means that an optimal solution was found, but that the sequence of iterates did not converge. There are several reasons this can happen, including starting at the correct values. It generally does not indicate a problem. These estimates can generally be considered correct solutions, so this code is labeled (Mx status GREEN). | ||
+ | * A value of −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. | ||
+ | * A value of 2 or 3 means that the bounds or constraints, respectively, could not be satisfied. | ||
+ | * A value of 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() using the output –it will restart from the most recent set of estimates, and make another run of the same number of iterations. | ||
+ | * A value of 6 means that optimality conditions could not be reached, and the optimizer could find no way to improve the estimate. It often implies either a mistake in the model specification or starting values in an intractable range. The estimates resulting from this run are NOT optimal estimates, and should not be treated as solutions, so this code is labeled (Mx status RED). |
Revision as of 21:35, 21 May 2018
Here are example scripts in OpenMx for a variety of models. Most models will utilize twin samples.
Common Path Model in One Twin Sample
Linear Growth Model in One Twin Sample
OpenMx Optimizer Codes
These descriptions are from Mike Neale at [1]
- A value of −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. Estimates from runs with output$status1 equal to -1 can never be trusted, and the job must be re-run with different starting values, or a corrected model specification.
- A value of 6 means that optimality conditions could not be reached, and the optimizer could find no way to improve the estimate. It often implies either a mistake in the model specification or starting values in an intractable range. The estimates resulting from this run are often NOT optimal estimates, and should not be treated as solutions, so this code is labeled (Mx status RED). The job should be re-run, either from the final solution, or from new starting values, or both. If multiple different starting values converge on the same solution (same parameter estimates and fit function) then confidence that the minimum has been found increases.
The following descriptions are from that same thread. They are less useful.
- A value of 0 means a successful optimization--no error returned.
- A value of 1 means that an optimal solution was found, but that the sequence of iterates did not converge. There are several reasons this can happen, including starting at the correct values. It generally does not indicate a problem. These estimates can generally be considered correct solutions, so this code is labeled (Mx status GREEN).
- A value of −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.
- A value of 2 or 3 means that the bounds or constraints, respectively, could not be satisfied.
- A value of 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() using the output –it will restart from the most recent set of estimates, and make another run of the same number of iterations.
- A value of 6 means that optimality conditions could not be reached, and the optimizer could find no way to improve the estimate. It often implies either a mistake in the model specification or starting values in an intractable range. The estimates resulting from this run are NOT optimal estimates, and should not be treated as solutions, so this code is labeled (Mx status RED).