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

Posted on
No user picture. Veronica_echo Joined: 02/23/2018
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!

Replied on Sun, 04/15/2018 - 13:43
Picture of user. AdminRobK Joined: 01/24/2014

In reply to by Veronica_echo

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, and class3, and see it that makes a difference. Alternately, you could try defining sloLoads differently, so that its labels are paste0("GMM2Class.data.T", 1:10) when used with the two-component model, and paste0("GMM3Class.data.T", 1:10) when used with the three-component model.

Replied on Tue, 04/17/2018 - 11:02
No user picture. Veronica_echo Joined: 02/23/2018

In reply to by AdminRobK

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.
Replied on Fri, 04/27/2018 - 14:05
Picture of user. AdminRobK Joined: 01/24/2014

In reply to by Veronica_echo

I am wondering if it has specific requirement for 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?

Replied on Mon, 04/30/2018 - 10:30
Picture of user. AdminRobK Joined: 01/24/2014

In reply to by Veronica_echo

You might need to additionally pass argument repos=NULL to install.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.

Replied on Tue, 05/01/2018 - 11:35
No user picture. Veronica_echo Joined: 02/23/2018

In reply to by AdminRobK

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!
Replied on Tue, 05/01/2018 - 13:04
Picture of user. jpritikin Joined: 05/23/2012

In reply to by Veronica_echo

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
Replied on Tue, 05/01/2018 - 13:06
Picture of user. AdminRobK Joined: 01/24/2014

In reply to by Veronica_echo

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