I am unfamiliar with "MX%P=" but it sounds similar to the vector=TRUE argument of the mxFIMLObjective() function. The demo 'OneFactorModel_LikelihoodVector' has an example of using this argument.
The documentation shows that mxRAMObjective allows a parameter "vector", but my version mxVersion=="0.3.3-1264" does not implement this parameter. Has this been changed in a more recent version?
Although one can use vector=TRUE, it is a bit of a shame that one cannot see the vector of individual likelihoods unless one uses this alternative approach - which involves using an mxAlgebra and mxAlgebraObjective. Unless someone knows another way to retrieve them?
We have talked about this feature for several months. So I implemented it today. In the latest version from the svn repository, I've added the '@likelihoods' slot to MxFIMLObjective and MxRAMObjective objects. It stores a vector with the likelihood values. This will be included in the OpenMx 1.2 release. We need some test cases to verify this feature is working correctly. The ordinal and joint ordinal/continuous implementations are trickier than the continuous implementation, so it would be good to test all three alternatives.
Really superb! So pleased to have this information coming back. The only case when one might not want it to be potentially available would be where bandwidth is a concern and a large raw dataset is being analyzed. In this case one might want to switch it off. This might apply to the contents of other slots, so I am wondering whether an argument of the form
I think mxOption is a better place for this than mxRun.
First of all, we need to limit the number of argument to mxRun to keep complexity down for the user.
Second, this is actually an option that people would want to change for each individual objective function, rather than for each overall run.
Third, it's something that many people will either want to have returned, or just won't care about at all. Since it's fairly cheap to return in the general case, it's unlikely to be changed by many folks. That means that an argument to mxRun runs a higher risk of confusing people than it does of helping them.
I'd recommend instead that we use the mxOption interface the way that we do for the RAM Optimization and Data Sorting; these can be set for each child model or for the parent model as a whole, and we can add options boundlessly without adding too much confusion.
I'd probably also stick to names like "Return Row Likelihoods" so that what they do is clear.
Sorry to revive this old thread; it is the most relevant I could find. I'm wondering if it's possible to retrieve the likelihood vector for arbitrary models? I'm running a model using mxExpectationMixture(), and when I set vector = TRUE on the fitfunction, I get this error:
Running mix2 with 13 parameters
Error: The job for model 'mix2' exited abnormally with the error message: mix2.fitfunction of type imxFitFunciontHiddenMarkov returned 150 values instead of 1, not sure how to proceed
For many models, the best thing to do is use the rowDiagnostics argument of the mxFitFunctionML() function. Something like this:
mxFitFunctionML(rowDiagnostics=TRUE)
This returns row likelihoods, row Mahalanobis distances, and the number of non-missing variables by row. See the help page via ?mxFitFunctionML for further details and example use.
I am unfamiliar with "MX%P=" but it sounds similar to the vector=TRUE argument of the
mxFIMLObjective()
function. The demo 'OneFactorModel_LikelihoodVector' has an example of using this argument.Thanks! That is exactly what I wanted to know.
A related issue:
The documentation shows that mxRAMObjective allows a parameter "vector", but my version mxVersion=="0.3.3-1264" does not implement this parameter. Has this been changed in a more recent version?
Please download the most recent stable release, which as of July 20, 2011 is OpenMx 1.0.7:
source('http://openmx.psyc.virginia.edu/getOpenMx.R')
.Although one can use vector=TRUE, it is a bit of a shame that one cannot see the vector of individual likelihoods unless one uses this alternative approach - which involves using an mxAlgebra and mxAlgebraObjective. Unless someone knows another way to retrieve them?
We have talked about this feature for several months. So I implemented it today. In the latest version from the svn repository, I've added the '@likelihoods' slot to MxFIMLObjective and MxRAMObjective objects. It stores a vector with the likelihood values. This will be included in the OpenMx 1.2 release. We need some test cases to verify this feature is working correctly. The ordinal and joint ordinal/continuous implementations are trickier than the continuous implementation, so it would be good to test all three alternatives.
Really superb! So pleased to have this information coming back. The only case when one might not want it to be potentially available would be where bandwidth is a concern and a large raw dataset is being analyzed. In this case one might want to switch it off. This might apply to the contents of other slots, so I am wondering whether an argument of the form
mxRun(model, slotsNotWanted=list("estimatedHessian","likelihoods","otherStuff")
would offer the user control over the volume of information being passed back to R from the backend.
I think mxOption is a better place for this than mxRun.
First of all, we need to limit the number of argument to mxRun to keep complexity down for the user.
Second, this is actually an option that people would want to change for each individual objective function, rather than for each overall run.
Third, it's something that many people will either want to have returned, or just won't care about at all. Since it's fairly cheap to return in the general case, it's unlikely to be changed by many folks. That means that an argument to mxRun runs a higher risk of confusing people than it does of helping them.
I'd recommend instead that we use the mxOption interface the way that we do for the RAM Optimization and Data Sorting; these can be set for each child model or for the parent model as a whole, and we can add options boundlessly without adding too much confusion.
I'd probably also stick to names like "Return Row Likelihoods" so that what they do is clear.
Agreed, 100%
0.3.3 is an old version. Install the current 1.0.7 release by following these instructions:
http://openmx.psyc.virginia.edu/installing-openmx
Further, you can install the beta 1.1 release and use/test even newer features like so:
http://openmx.psyc.virginia.edu/2011/06/more-stable-openmx-11-beta-release
Sorry to revive this old thread; it is the most relevant I could find. I'm wondering if it's possible to retrieve the likelihood vector for arbitrary models? I'm running a model using
mxExpectationMixture()
, and when I setvector = TRUE
on the fitfunction, I get this error:Running mix2 with 13 parameters
Error: The job for model 'mix2' exited abnormally with the error message: mix2.fitfunction of type imxFitFunciontHiddenMarkov returned 150 values instead of 1, not sure how to proceed
Ah, nevermind - I see that the individual likelihoods are already included, but in the submodels!
Apologies, but glad you could figure it out!
For many models, the best thing to do is use the
rowDiagnostics
argument of themxFitFunctionML()
function. Something like this:This returns row likelihoods, row Mahalanobis distances, and the number of non-missing variables by row. See the help page via
?mxFitFunctionML
for further details and example use.