Coder Social home page Coder Social logo

string syntax for umxRAM about umx HOT 5 CLOSED

tbates avatar tbates commented on August 25, 2024
string syntax for umxRAM

from umx.

Comments (5)

bwiernik avatar bwiernik commented on August 25, 2024 1

I agree that either graphviz or sem has the most intuitive syntax. sem exactly would be convenient to make it maximally easy to re-use scripts in umx. A reasonable compromise would be to throw a warning if a string syntax model is fit without latent/manifest variances, etc.

Functions for umx_lavaan2RAM, umx_lavaan2RAM, and umx_lavaan2RAM would be really nice for adapting published scripts. These could perhaps return lists of umx paths. They should include the automatic paths assumed by the various programs, with warnings that they were added. Positioning these functions as conversion tools, not recommended for building one’s own models, would be good.

from umx.

tbates avatar tbates commented on August 25, 2024 1

Decided to treat the lavaan syntax as a universal grammar for SEM, and add ability to process this in umx via umxRAM

from umx.

tbates avatar tbates commented on August 25, 2024

One option is to create umx_lavaan2RAM() and let people use that. Trouble is lavaan, like mplus, has defaults, so that code would involve more than just translating what the user requested, but also what lavaan decided their request implied (like variances for manifests etc. I've always avoided that it only seems smart for about a day...

I am thinking now that the syntax I most like playing with is graphviz, paradoxically also invented at AT&T by the guys who did R.

It's very sem like, so just:

    A -> B

Which obviates typing all the functions, parameter names, commas and = signs and closing brackets and trailing commas that frustrate people

A nice thing might be to allow abbreviation lists, so that for instance instead of typing:

    umxRAM(paths = "
        Stress <-> Extraversion,
        Extraversion -> Depression
        Stress -> Depression"
    )

One could say

    umxRAM(vars = c(S = Stress, E = "Extraversion", D = "Depression), paths = "
        S <-> E,
        S E -> D"
    )

Both are probably easier than:

    umxRAM("myModel",
        umxPath("Stress", with = "Extraversion"),
        umxPath(c("Stress", "Extraversion"), to = "Depression")
    )

Which in turn beats

    mxModel("myModel", type = "RAM",
       manifests = c("Stress", "Extraversion", "Depression") 
        mxPath("Stress", to = "Extraversion", arrows= 2),
        mxPath(c("Stress", "Extraversion"), to = "Depression")
    )

from umx.

mcneale avatar mcneale commented on August 25, 2024

Good plan! Is it best to go Lavaan -> Umx or directly Lavaan -> OpenMx?

from umx.

tbates avatar tbates commented on August 25, 2024

The lavaan is processed using a mix of umx or OpenMx calls as is easiest.

It all just comes back as an MxRAMModel with sub models if it's multi-group

But a lot of umx to get the auto-means, auto data-set trimming, labels, start values, group= facility etc etc.

from umx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.