The new 2-part objectives in OpenMx mean an older method for testing if a model is a RAM model don't work
I used to say this:
(isS4(obj) && is(obj, "MxModel") && class(obj$objective)[1] == "MxRAMObjective")
What code do people recommend for backward (and preferably forward compatible testing of model type? Do we need to add a type= field to MXModel?
best, tim
Haven't gotten this far in the Expectation/Fit split, but it'll likely be as simple as replacing references to objective to references to expectation. I'll look into this more as we get closer to beta release.
maybe an OpenMx supported function to maintain a robust backward compatible test for users. Perhaps allowing
Your same code would work if you replace $objective with $expectation, and "MxRAMObjective" with "MxExpectationRAM". I'm not sure if that's the best practice, but it would work currently.
this fails for current OpenMx.
so the "good today, great tomorrow" test is
:-)
This passes with the current source build.
where obj is a fitted OpenMx model. I used demo/LatentGrowthCurveModel_PathRaw.R as a test case.