Error Message - LCGA 1 Class
Posted on

Attachment | Size |
---|---|
Capture LCGA 1 class summary.PNG | 38.99 KB |
Provisional LCGA 1 class script.txt | 2.91 KB |
Forums
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.
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
no idea about error; suggestions for your script
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 with `mxTryHard()`. One way to interpret what `mxTryHard()` 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 for `mxComputeSimAnnealing()`, regarding in particular the control parameters `tempStart`, `tempEnd`, and `stepsPerTemp`. 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:
plan <- omxDefaultComputePlan()
plan$steps <- list(
SA=mxComputeSimAnnealing(),
GD=plan$steps$GD,
ND=plan$steps$ND,
SE=plan$steps$SE,
HQ=plan$steps$HQ,
RD=plan$steps$RD,
RE=plan$steps$RE
)
Log in or register to post comments
In reply to no idea about error; suggestions for your script by AdminRobK
Thank you so much for your detailed reply.
Log in or register to post comments
Implementation of Simulated Annealing - Question
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.
Log in or register to post comments
plan
plan <- omxDefaultComputePlan()
plan$steps <- list(
SA=mxComputeSimAnnealing(method='tsallis1996', control=list(stepsPerTemp=3)),
GD=plan$steps$GD,
ND=plan$steps$ND,
SE=plan$steps$SE,
HQ=plan$steps$HQ,
RD=plan$steps$RD,
RE=plan$steps$RE
)
And, define your main MxModel like this:
gmm.2.means <- mxModel('2Class Means Growth Mixture Model',
mxData(observed=OpenMx_dfwide_poster1, type='raw'),
class1, class2, classRP, classP, algObj, obj, plan)
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).
Log in or register to post comments