SEM without free parameters troubles OpenMX (and myself)

Today, I felt like fixing all my free parameters and call mxRun() on my model. I expected the optimizer to converge instantly or rather not to be invoked. Instead, it seems the backend is running into an infinite loop somehow. Maybe the backend needs to check the condition of no free parameters in the model.
I did this (admitted, a rather strange setting) because I intended to evaluate the -2LL of dataset "A" on a model that I ran previously on dataset "B". I thought if I fixed all parameters, set the dataset to "A" and mxRun() it, I'd get the desired -2LL of "A" under the model estimated by "B" as a result. So, I wonder what you suggest as the standard way to obtain a likelihood of a different dataset given an estimated model.
best,
Andreas
I'd like to address one of
Log in or register to post comments
Hmm. Fixing all the
Fixing all the parameters in the model and calling mxRun() on it should work.
In the back-end, the optimizer should never be called if there are no free parameters, so all the algebras and objective values should simply be computed at the starting values. So it should be a few quick calculations and you should get a result back like any other model.
This may be a bug in OpenMx. Could you post code and data (or simplified code and simulated data) that exhibits the behavior? The fakeData command (described on the Generating Simulated Data page) is a good way to simulate some data for posting.
Also, what versions of OpenMx and R are you running, and on what operating system?
Thanks! We'll try to get this fixed as soon as we can.
Log in or register to post comments
In reply to Hmm. Fixing all the by tbrick
Thanks for your quick
description of the script:
The script estimates the mean of a variable with unit variance. The data is generated from a standard normal distribution. Running the model works fine. Then I fix all parameters and rerun the model. This time, the optimizer seems to get stuck.
I use openmx version number: 999.0.0-1448 and R version 2.11.1 (2010-05-31) on OSX 10.6.4
thanks for your help,
Andreas
Log in or register to post comments
In reply to Thanks for your quick by brandmaier
here's a more compact
require("OpenMx")
# create a dummy model which estimates the mean of an observed variable with unit variance
data <- data.frame(rnorm(1000,0,1))
manifest = c("Y")
names(data) <- manifest
model1 <- mxModel("One Factor", type="RAM",
manifestVars = manifest,
mxPath(manifest, arrows=2, free=T, values=1.0, label="lat_var"),
mxPath("one", to=manifest, arrows=1, free=T, values=1, labels="mean"),
mxData(data, type="raw", numObs=dim(data)[1])
);
fit1 <- mxRun(model1);
# fix free parameters
model2 = mxRename(omxSetParameters(fit1, labels=c("lat_var", "mean"), free=F, value = 0),"fixed")
fit2 = mxRun(model2)
# you will be waiting a long time here :-)
mxCompare(fit1, c(fit2))
Log in or register to post comments
In reply to here's a more compact by tbates
I also get the slow-down. If
Log in or register to post comments
In reply to I also get the slow-down. If by Ryne
Whoops. We have a bug in the
I'm working on a patch for this issue. Should have OpenMx 1.0.3 out by the end of the night. Thanks to Andreas for spotting the bug. And Tim Bates and Ryne for testing out scripts. And Tim Brick for tracking down the bug.
Log in or register to post comments
Fixed in version 1.0.3.
Log in or register to post comments
In reply to Fixed in version 1.0.3. by mspiegel
excellent! You're great,
Log in or register to post comments