Attachment | Size |
---|---|

Openmx1.R | 11.05 KB |

I am trying to get the confidence intervals for the ACE model, but for some reason they are not showing up in OpenMX version 2. I have been advised to try and run the model in OpenMX version 1.4 so I have been changing some functions in my code to make it compatible.

So far I changed mxExpectationNormal to mxFIMLObjective; and mxFitFunctionAlgebra with mxAlgebraObjective based on what i've found online.

I am still getting one error as follows:

"Error: could not find function "mxFitFunctionML"

Could you please advise how I should edit my code for it to work in OpenMX version 1.4?

Thanks!

`mxFitFunctionML()`

didn't exist in OpenMx version 1. Instead, "objectives" carried out the roles that are now split between "fitfunctions" and "expectations." Just delete all the instances of`mxFitFunctionML()`

from your code; they're extraneous.Could you describe this problem further?

Thank you very much for your quick reply RobK. I apologize for the late reply, I was just moving back and forth between the different OpenMX versions.

The problem was that when trying to generate confidence intervals for the sub models AE and CE, I would get an error (NA !!!) in some of the upper bounds, and when I expand the results I would get an upper bound greater than 1. This problem occurs when I run these sub models in the new OpenMX with the following code:

CEModel <-mxModel( AceFit, name="CE")

CEModel <-omxSetParameters( CEModel, labels="a11", free=F, values=0 )

CEFit <-mxRun(CEModel, intervals=T)

(CESum <-summary(CEFit, verbose=T))

round(CEFit@output$estimate,4)

round(CEFit$Est@result,4)

mxEval(MZ.A, CEFit)

mxEval(MZ.C, CEFit)

mxEval(MZ.E, CEFit)

The results for the confidence intervals are as follows:

confidence intervals:

bound estimate ubound note

MZ.A[1,1] NA 0.0000000 NA !!!

MZ.C[1,1] 0.3630855 0.4230395 0.5282773

MZ.E[1,1] 0.4717223 0.5769605 NA !!!

CI details:

parameter value side fit BaTH BsTH BpTH BparTH Th11 c11 e11

1 MZ.A[1,1] 0.0000000 upper 1887.154 -0.01503094 -0.2214035 0.01372319 -0.3057541 1.977253 0.6504149 0.7595791

2 MZ.A[1,1] 0.0000000 lower 1887.154 -0.01503094 -0.2214035 0.01372319 -0.3057541 1.977253 0.6504149 0.7595791

3 MZ.C[1,1] 0.5282773 upper 1890.996 -0.01514985 -0.2152637 0.01637458 -0.2903185 1.930830 0.7268269 0.6868207

4 MZ.C[1,1] 0.3630855 lower 1890.995 -0.01265185 -0.2719947 0.02252237 -0.2785094 1.937280 -0.6025657 0.7980692

5 MZ.E[1,1] 1.1683689 upper 1937.110 -0.01503094 -0.2214035 0.01372319 -0.3057541 1.977253 0.2751512 1.0809111

6 MZ.E[1,1] 0.4717223 lower 1890.996 -0.01514503 -0.2153946 0.01639248 -0.2906954 1.931692 0.7268271 0.6868205

I tried running this on OpenMX V1 with the following code and results:

CEModel <-mxModel( AceFit, name="CE")

> CEModel <-omxSetParameters( CEModel, labels="a11", free=F, values=0 )

> CEFit <-mxRun(CEModel, intervals=T)

> (CESum <-summary(CEFit, verbose=T))

Confidence intervals:

MZ.A[1,1] 0.0000000 0.0000000 0.0000000

MZ.C[1,1] 0.3084175 0.4230232 0.5283611

MZ.E[1,1] 0.4716388 0.5769768 0.6915826

Thanks again for you help!

I see. So when you were using OpenMx version 2, the upper confidence limit for the standardized E component was (nonsensically) greater than 1, and more importantly, corresponded to a worsening in fit vastly different from the target of 3.841. For the latter reason, OpenMx version 2 didn't report such an obviously wrong confidence limit in summary() output.

In OpenMx v2.2.x and later, the on-load default optimizer is SLSQP, whereas in OpenMx version 1.x, NPSOL was the only available optimizer. I don't see in your script that you switched optimizers anyplace. I'm wondering, if you stuck

`mxOption(NULL,"Default optimizer","NPSOL")`

in your script, after you load packages, would you then get the same results that you got from OpenMx version 1?