bootstrap likelihood ratio test (BLRT) for GMM with definition variables
Posted on

Attachment | Size |
---|---|
Screen Shot 2018-04-13 at 2.35.08 PM.png | 95.67 KB |
Forums
Hi everyone,
I would like to conduct BLRT test for 2 nested GMM model with definition variables. I referred to a previous post
https://openmx.ssri.psu.edu/node/4329 and it worked well on my computer. However, when I run the comparison of my model, it reported errors. I attached a screenshot of LRT without and with bootstrap in the attachment. And here is the information of my OpenMx Version:
> mxVersion()
OpenMx version: 2.9.6 [GIT v2.9.6]
R version: R version 3.4.4 (2018-03-15)
Platform: x86_64-apple-darwin15.6.0
MacOS: 10.13.4
Default optimiser: CSOLNP
NPSOL-enabled?: Yes
OpenMP-enabled?: Yes
Thanks in advance!
Script?
You should post your current script.
Log in or register to post comments
In reply to Script? by AdminRobK
Thanks for kind and prompt
Thanks for kind and prompt reply. I've attached dataset and codes I am using. Thanks in advance!
Log in or register to post comments
In reply to Thanks for kind and prompt by Veronica_echo
I reproduce the error you
I reproduce the error you report. I think this is a bug. A model using an MxExpectationMixture will run if the mixture components contain definition variables but the data are in the container model, and not the mixture-component. But,
mxGenerateData()
raises an error if it sees definition variables inside an MxModel object that doesn't contain an MxData object.The bug-fix will seemingly require modifying the behavior of
mxGenerateData()
when used with models that have MxExpectationMixture.As a workaround, try putting the MxData object inside the mixture components
class1
,class2
, andclass3
, and see it that makes a difference. Alternately, you could try definingsloLoads
differently, so that its labels arepaste0("GMM2Class.data.T", 1:10)
when used with the two-component model, andpaste0("GMM3Class.data.T", 1:10)
when used with the three-component model.Log in or register to post comments
In reply to I reproduce the error you by AdminRobK
Thanks for advice
Thanks for your kind advice. I've tried to put the raw data in each class. However, every time I tried run it, R studio would be terminated since "R encountered a fatal error" and I don't know why. Also, relabeling the definition variables did not work either. I've included the updated version with data in the attachment. Thank you.
Log in or register to post comments
In reply to I reproduce the error you by AdminRobK
Another error
BTW, it seems that the function mxBootstrap() does not work well if I put mxData outside the class1, class2 and class3. But it works if I put the data in each class. Thanks.
Log in or register to post comments
In reply to Another error by Veronica_echo
mxBootstrap
Yes, these are symptoms of the same problem with mxGenerateData.
Log in or register to post comments
In reply to mxBootstrap by jpritikin
Wait, I don't think that's
Wait, I don't think that's the case.
mxBootstrap()
is for nonparametric bootstrapping, so its behavior doesn't depend uponmxGenerateData()
.Log in or register to post comments
In reply to Wait, I don't think that's by AdminRobK
Rob is correct
What exactly is going wrong with mxBootstrap?
Log in or register to post comments
investigating
Something is going wrong with data generation.
Log in or register to post comments
In reply to investigating by jpritikin
a bunch of stuff related to inherited MxData was broken
Yeah, you can probably get your stuff to work with the current version of OpenMx by copying the data into the class components. Anyway, fixed in v2.9.6-48-g17adc932f
Log in or register to post comments
In reply to a bunch of stuff related to inherited MxData was broken by jpritikin
Thank you
Tried it, but R studio would be terminated every time. And glad to know it will be fixed. May I know when v2.9.6-48-g17adc932f will be available (approximated date is good enough)? Thank you very much!
Log in or register to post comments
In reply to Thank you by Veronica_echo
os/x builds
You could try the builds [here](https://vipbg.vcu.edu/vipbg/OpenMx2/software/bin/macosx/travis/)
Log in or register to post comments
In reply to Thank you by Veronica_echo
Specifically, you could try
Specifically, you could try downloading this MacOS package binary and installing it.
Log in or register to post comments
In reply to Specifically, you could try by AdminRobK
Requirement for R version
Thanks for your kind reply. I tried, however, it seems not available for R version 3.4.4. I am wondering if it has specific requirement for r version. Thank you very much!
Log in or register to post comments
In reply to Requirement for R version by Veronica_echo
R version
Not that I know of. But, I'm not involved in building OpenMx for MacOS. Are you downloading the file and installing the package from that local file?
Log in or register to post comments
In reply to R version by AdminRobK
Yep, and here is the
Yep, and here is the screenshot
Log in or register to post comments
In reply to Yep, and here is the by Veronica_echo
You might need to
You might need to additionally pass argument
repos=NULL
toinstall.packages()
to install a local file.You use RStudio, right? It's also possible to install a local file with RStudio's package-installation interface.
Also, the extension of a MacOS package binary should be .tgz, not .tar.
Log in or register to post comments
In reply to You might need to by AdminRobK
Yes, it works now. Thank you
Yes, it works now. Thank you very much!
Log in or register to post comments
In reply to Specifically, you could try by AdminRobK
One more question
I run mxCompare(model1, model2, boot=TRUE) on my computer using 4 cores overnight, but it did not work... I mean I did not get any result until now... Should it take longer? If so, I may want to run it on cluster. May I know how to upgrade the package on cluster? Thank you very much!
Log in or register to post comments
In reply to One more question by Veronica_echo
cluster
Who manages your cluster? You'll probably want to talk to that person for guidance.
Log in or register to post comments
In reply to cluster by jpritikin
Thanks for your kind advice!
Thanks for your kind advice! I firstly may want to check if the BLRT for definition variables is available for linux system. If so, which version should be used? Thank you very much!
Log in or register to post comments
In reply to Thanks for your kind advice! by Veronica_echo
def vars
What's implemented is data generation assuming that def vars are fixed. If that's what you want then it should work. You can test whether data generation works the way you expect with mxGenerateData
Log in or register to post comments
In reply to Thanks for your kind advice! by Veronica_echo
I agree with Joshua
I agree with Joshua: the best person to ask is your cluster's sysadmin. If I had to guess, I would recommend following the instructions under "Unix installation" here, except with an additional shell command:
git clone git@github.com:OpenMx/OpenMx.git
cd OpenMx/
git checkout stable
make install
Log in or register to post comments
Yes, I think so
Yes, I think so
Log in or register to post comments