You are here

Error : The RAM model 'blahblah' does not contain any paths

4 posts / 0 new
Last post
CharlesD's picture
Offline
Joined: 04/30/2013 - 11:05
Error : The RAM model 'blahblah' does not contain any paths

This occurs after I change the data associated with an otherwise working matrix specification model... I don't think it should :)

AdminJosh's picture
Offline
Joined: 12/12/2012 - 12:15
gosh

The error is triggered by the following test,

      if ((length(model$A) == 0) ||
          (length(model$S) == 0) ||
          (length(model$F) == 0)) {

Are you using non-default names for these matrices?

I am puzzled why changing the data would cause this error to trigger. Can you provide a script to reproduce the problem?

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
OpenMx thinks your matrix model is type="RAM"?

Certainly it ought not happen, but I am not quite following the use case

The error implies the model type ="RAM". But model type for matrix models is default, and the expectations etc are different.

Can you please check the following on your pre and post change models?

class(tmpMatMode)[1] == "MxRAMModel"
class(tmpMatMode$objective[[1]])[1] == "MxExpectationRAM"

e.g.

tmpMatMod <- mxModel("tmpMatMod",
    mxExpectationNormal(covariance="expCov", means="expMeans"),
    mxFitFunctionML()
)
 
class(tmpMatMod)[1] == "MxRAMModel"  # FALSE
class(tmpMatMod$objective[[1]])[1] == "MxExpectationRAM"  # FALSE
 
data(myFADataRaw)
manifests = names(myFADataRaw); latents   = c("G")
myFADataRaw = myFADataRaw[, manifests]
tmpRAM <- mxModel("tmpRAM", type="RAM",
    manifestVars = manifests, latentVars   = latents,
    mxPath(from = latents, to = manifests),
    mxPath(from = manifests, arrows = 2), # manifest residuals 
    mxPath(from = latents, arrows = 2, free = F, values = 1), # latents fixed@1
    mxData(cov(myFADataRaw, use="complete"), type = "cov", numObs = nrow(myFADataRaw))
)
 
class(tmpRAM)[1] == "MxRAMModel" # TRUE
class(tmpRAM$objective[[1]])[1] == "MxExpectationRAM" # TRUE
CharlesD's picture
Offline
Joined: 04/30/2013 - 11:05
Ok, good pickup. I don't

Ok, good pickup. I don't remember why, but I do remember that for earlier versions of OpenMx I had to specify type='RAM' or else various things seemed to break. Could also be a bug in my own code that somehow improved along the way I guess... or in worst case I'll find over the coming week that certain things are not working :) Anyway, when I leave out the type argument, I'm able to change my data later with no problem. So, cheers!