Attachment | Size |
---|---|
Capture LCGA 1 class summary.PNG | 38.99 KB |
Provisional LCGA 1 class script.txt | 2.91 KB |
Hello,
Could you help me understanding the following error message when fitting a 1class LCGA (Script and summary attached)?
Eventually, I obtain the results, but I am a bit skeptical due to the error message.
Fit attempt 10, fit=364650.77991012, new current best! (was 366100.551846931)Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'
Retry limit reached; solution not found. Best fit=364650.78 (started at 1881335.6) (11 attempt(s): 9 valid, 2 errors)
Thank you very much for your time!!
> mxVersion()
OpenMx version: 2.12.2 [GIT v2.12.2]
R version: R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32
Default optimizer: CSOLNP
NPSOL-enabled?: Yes
OpenMP-enabled?: No
I have no idea how to interpret the error message you report. It doesn't look familiar to me. You may be able to get more information about what caused it if you run
traceback()
right after your call tomxTryHard()
. Since you seem to have successfully assigned the output frommxTryHard()
to symbolmxTryHard_lcga.1.means.fit
and were able to runsummary()
on it, I'm guessing the error wasn't fatal, and probably accounts for 1 of the 2 fit attempts thatmxTryHard()
says ended in errors.I should warn you that your model is unidentified. Specifically, the parameter labeled 'p1' shouldn't be free. Just fix it to 1.
Also, I suggest either using simulated annealing without
mxTryHard()
, or using one of the main gradient-based optimizers withmxTryHard()
. One way to interpret whatmxTryHard()
does is that it crudely approximates simulated annealing with a deterministic gradient-based optimizer. However, if you're actually using simulated annealing, you are better off letting it do one very long run; consult the manual page formxComputeSimAnnealing()
, regarding in particular the control parameterstempStart
,tempEnd
, andstepsPerTemp
. In fact, if you put the following compute plan into your MxModel, you can do a global search with simulated annealing and follow it up with a local search using one of the gradient-based optimizers:Very helpful comments, I'll check everything out!!!!
Hello,
I have tried implementing the Simulated Annealing as suggested.
However, I am having a hard time in finding examples out in the forum or in the internet. The only source I have found is this one: https://rdrr.io/github/OpenMx/OpenMx/src/inst/models/passing/DogChain.R
I have tried running this piece of code for a GMM instead that for a LCGA, and after one day waiting it was still running. Is there something wrong with my code related to mxComputeSimAnnealing? Any advice?
gmm.2.means <- mxModel('2Class Means Growth Mixture Model',
mxData(observed=OpenMx_dfwide_poster1, type='raw'),
class1, class2, classRP, classP, algObj, obj, mxComputeSimAnnealing(plan = plan, method='tsallis1996', control=list(stepsPerTemp=3)))
Attached the whole code.
Many thanks for your help.
Define
plan
like this:And, define your main MxModel like this:
Note that simulated annealing is not user-interruptible in OpenMx v2.12.2. That's a bug that has been repaired in the source repository, and will be repaired in the next release of OpenMx (which will likely happen by the end of the month).