I have an example OpenMx script written a few years ago to do twin modelling.
It was written for OpenMx version 1.0 (script linked here )
When I run it, there are some warnings about updating fit functions and objectives. How should I update it to use OpenMx 2.0 fit function calls?
There are a small number of changes from OpenMx 1.0 to 2.0 and higher. Nearly all scripts will run fine, but some pre-2012 or will benefit in features if you update for OpenMx 2.x
An example is referenced here
The user had hassles with:
1. No path to the helper functions
This is a more generic robustness issue for example R code: better to include web urls rather than disk-based file paths.
A better solution is CRAN-based helper packages like umx. These are easier to keep up to date and accessible.
2. Old-style objectives (instead of expectations and fit functions)
Calls like this one are deprecated:
It’s easy to update these across a stack of scripts, replacing
mxFIMLObjective
withmxExpectationNormal
+ a call tomxFitFunctionML
In addition, in old-style multiple-group objectives like this:
You should replace
mxAlgebraObjective
withmxFitFunctionAlgebra
However, OpenMx 2 has a neat Multigroup function which handles this in one line and enables identification checks, reference model generation etc.
So just replace the whole thing with (for example):