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

Posted on
No user picture. CharlesD Joined: 04/30/2013

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

Replied on Thu, 10/30/2014 - 15:10
No user picture. AdminJosh Joined: Dec 12, 2012

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?

Replied on Mon, 11/03/2014 - 08:10
Picture of user. tbates Joined: Jul 31, 2009

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

Replied on Mon, 11/03/2014 - 11:21
No user picture. CharlesD Joined: Apr 30, 2013

In reply to by tbates

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!