Bootstrap Likelihood Ratio Test
Posted on
matthewcgraham
Joined: 02/20/2018
Attachment | Size |
---|---|
GrahamM_BLRT.R | 6.34 KB |
Forums
I'm interested in using the new bootstrap function in mxCompare to evaluate nested growth mixture models (GMM) using the Bootstrap Likelihood Ratio Test (BLRT), but am a uncertain how to do so. For example, in the attached code building on the GMM example provided in the OpenMx documentation, say I wanted to compare a three-class model to a two-class model. How would I conduct the BLRT?
OpenMx version: 2.8.3 [GIT v2.8.3]
R version: R version 3.4.1 Patched (2017-08-09 r73082)
Platform: x86_64-w64-mingw32
Default optimiser: CSOLNP
NPSOL-enabled?: Yes
OpenMP-enabled?: No
read the man page?
mxCompare(gmm3Fit, gmm2Fit, boot=TRUE)
? You should find detailed documentation in the mxCompare man page. Let us know if we might improve the documentation.Log in or register to post comments
Bootstrap Function Does Not Seem to Function when Comparing GMMs
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘genericGenerateData’ for signature ‘"NULL"’
Error: Cannot bootstrap null model 'GMM2Class'
OpenMx version: 2.8.3 [GIT v2.8.3]
R version: R version 3.4.1 Patched (2017-08-09 r73082)
Platform: x86_64-w64-mingw32
Default optimiser: CSOLNP
NPSOL-enabled?: Yes
OpenMP-enabled?: No
Log in or register to post comments
In reply to Bootstrap Function Does Not Seem to Function when Comparing GMMs by matthewcgraham
expectation
mxExpectationMixture()
andmxFitFunctionML()
.Edit: that's probably something the documentation needs to say...
Log in or register to post comments
In reply to expectation by AdminRobK
oh! mixture
Log in or register to post comments
In reply to oh! mixture by jpritikin
parametric
Log in or register to post comments
In reply to parametric by AdminRobK
null distribution
Log in or register to post comments
Struggling to Adapt GMM Code
MCG
Log in or register to post comments
In reply to Struggling to Adapt GMM Code by matthewcgraham
false start
You'll have to do this by hand. Write a loop around the whole script. Generate a random weight vector. Pass it to mxData(.., weight=weight). Execute the whole script (inner part of the loop). Aggregate and summarize output from mxCompare.
Log in or register to post comments
In reply to false start by jpritikin
mxGenerateData
That's a rather serious oversight...!
Edit: And I'm pretty sure you're still confused about what Matthew is trying to accomplish here.
Log in or register to post comments
In reply to mxGenerateData by AdminRobK
goal?
Log in or register to post comments
In reply to goal? by jpritikin
I am pretty sure he's simply
mxCompare()
, to test a null model with (say) 2 mixture components against an alternative model with (say) 3 mixture components. To do so, he needs to be able to generate data under the null model, fit the null model to the generated data, fit the alternative model to the generated data, store the difference in -2logL, and repeat the process for B replications. Unfortunately, the generic for data-generation currently has no method defined for MxExpectationMixture, so OpenMx cannot do what he wants in an automated fashion viamxCompare()
.Log in or register to post comments
In reply to I am pretty sure he's simply by AdminRobK
High priority
Log in or register to post comments
Yes, Exactly
Thank you all for your support,
MCG
Log in or register to post comments
In reply to Yes, Exactly by matthewcgraham
gotcha
Log in or register to post comments
In reply to gotcha by jpritikin
windows?
Log in or register to post comments
Yes, I use Windows
Thank you all so much for your attention and support!
Regards,
MCG
Log in or register to post comments