You are here

mxPath problem

5 posts / 0 new
Last post
carey's picture
Offline
Joined: 10/19/2009 - 15:38
mxPath problem

This is from BivariateSaturated_PathCov.R in the documentation

> bivSatModel1 <- mxModel("bivSat1",
+ manifestVars= selVars,
+ mxPath(
+ from=c("X", "Y"),
+ arrows=2,
+ free=T,
+ values=1,
+ lbound=.01,
+ labels=c("varX","varY")
+ ))
Error: The model type of model 'bivSat1' does not recognize paths.

any help?
greg

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Hmm, the version in the

Hmm, the version in the repository looks like this:

bivSatModel1 <- mxModel("bivSat1",
    manifestVars= selVars,
    mxPath(
        from=c("X", "Y"), 
        arrows=2, 
        free=T, 
        values=1, 
        lbound=.01, 
        labels=c("varX","varY")
    ),
    mxPath(
        from="X", 
        to="Y", 
        arrows=2, 
        free=T, 
        values=.2, 
        lbound=.01, 
        labels="covXY"
    ),
    mxData(
        observed=cov(testData), 
        type="cov", 
        numObs=1000 
    ),
    type="RAM"
)

The important argument to the mxModel() funciton is type="RAM" which creates a RAM model. Paths must be added to RAM type models.

carey's picture
Offline
Joined: 10/19/2009 - 15:38
strongly suggest that this be

strongly suggest that this be documentation be adjusted to note this fact. the following contains the relevant sections for "type" in the documentation to mxModel. there is no mention that type=RAM must be specified with mxPath.

type character vector. The name of the model type to assign to this model.

The model type is determined by a character vector supplied to the ‘type’ argument. The type of a model is a dynamic property, ie. it is allowed to change during the lifetype of the model. To see a list of available types, use the mxTypes command. When a new model is created and no type is specified, the type specified by options("mxDefaultType") is used.

To be estimated, MxModel objects must include objective functions as arguments (mxAlgebraObjective, mxFIMLObjective, mxMLObjective or mxRAMObjective) and executed using the mxRun function. When MxData objects are included in models, the 'type' argument of these objects may require or exclude certain objective functions, or set an objective function as default.

neale's picture
Offline
Joined: 07/31/2009 - 15:14
For my money, I would say

For my money, I would say that in this case it would be sensible for mxModel to automagically (aka by default) set the Type="Ram" argument because paths are clearly involved. This would save users - novice and expert alike - time.

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
Sounds good - unless there is

Sounds good - unless there is another path model, like lisrel...

Perhaps the thing would be to make type=ram the default whenever type is not set.