Attachment | Size |
---|---|
![]() | 16.6 KB |
![]() | 43.16 KB |
I am running a multivariate model (3 dependent vars) with sex (female MZ, male MZ, female DZ, male DZ, F&M DZ, M&F DZ) the model runs fine with the SLSQP optimizer.
No SEs are suspect and the return code is zero.
However when I try the command:
FitCholMod <- mxRun(CholMod, intervals =TRUE)
It runs as before but I receive this error message.
Error in runHelper(model, frontendStart, intervals, silent, suppressWarnings, :
NLOPT fatal error -1
So the confidence intervals are not produced.
I have tried the other optimizes. With CSOLNP a number of SEs are suspect. With NPSOL MX returns a code of 1 and more SEs are suspect.
I can obtain CIs with a worse fitting (non-preferred) model with the SLSQP optimizer. The non-preferred model has a significantly worse fit than the full-Cholesky, so I don't want to use that model.
With other models, just MZ vs DZ and a cohort model (young MZ, old MZ, young DZ, old DZ) I can obtain CIs.
I have several suspicions:
- I don't have enough male dizygotic twins !!!!
- I should rescale the dependent variables (years of education is left as is 8-18, income have been divided by $10,000, but occupational status still ranges from 0-100). I could divide occupational status by 10.
*It did seem to work before I downloaded the new MX version but I am at all not certain that I was analyzing the same model.
Any suggestions?
The CI code has recently undergone a rewrite. I'd be curious to know whether the current development version works. Can you install from https://github.com/OpenMx/OpenMx ?
(My 3rd Attempt _ I am not sure if I am replying correctly)
I tried to run the code from within R but got an error.
> source('https://github.com/OpenMx/OpenMx')
Error in source("https://github.com/OpenMx/OpenMx") :
https://github.com/OpenMx/OpenMx:5:1: unexpected '<'
4:
5: <
Should I try an earlier version of MX? I am not sure a how to do that.
The instruction above about "installing" from github is far from complete.
You'll need, for instance, a working compiler for fortran and C++. You can learn more here:
http://openmx.psyc.virginia.edu/wiki/howto-build-openmx-source-repository
It's fun, but a bit geeky. Alternatively, if you can share the model (just
save(CholMod, file = "CholMod.RData")
, a developer with the latest version could then check if you email the model file to them.Rescaling the variables might help. Also consider using
mxTryHard()
in place ofmxRun()
; make sure you're passing argumentintervals=TRUE
no matter which of the two you're using.If you're getting a good MLE with SLSQP, but SLSQP chokes on the confidence intervals, you could use a different optimizer for finding the point estimates versus finding the confidence limits. This requires a custom compute plan. The simplest way to do that is probably something like this (which assumes you've set SLSQP as the default optimizer earlier in the script):
Note that
fitCholAce
, and any MxModel object derived from it, will thereafter always calculate confidence intervals, regardless of whether argumentintervals
isTRUE
orFALSE
. You can restore the usual behavior by running the MxModel after setting the compute plan's.persist
slot toFALSE
.Edit: Looks like R's main assignment operator is being parsed as an HTML tag(?) in forum posts right now...
Thanks I feel I am making progress.
It's a good idea but I get an error after the MxRun command:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘assignId’ for signature ‘"list"’
I find the ML estimates for the SLSQP and CSOLNP optimizers are identical but they return status codes of zero and 6 respectively. When both produce CIs, for a straight MZ/DZ model they are also the same.
Ah, I bet the first call to
mxRun()
needs to haveintervals=T
, as inIf that doesn't help, I'd be curious to see the
traceback()
for that error message.OK, that's encouraging.