Skip to content

Instantly share code, notes, and snippets.

@tbates
Last active December 19, 2015 15:28
Show Gist options
  • Save tbates/5976338 to your computer and use it in GitHub Desktop.
Save tbates/5976338 to your computer and use it in GitHub Desktop.
ez run function. Let's modify this to compute the ind/saturated model?
# umxRun now detects raw RAM, and runs sat and ind. worth speeding this bit up a bit?
m3 <- mxModel("independence",
# TODO: slightly inefficient, as this has an analytic solution
mxMatrix(name = "variableLoadings" , type="Diag", nrow = nVar, ncol = nVar, free=T, values = independenceStarts),
# labels = loadingsLabels),
mxAlgebra(name = "expCov", expression = variableLoadings %*% t(variableLoadings)),
mxMatrix(name = "expMean", type = "Full", nrow = 1, ncol = nVar, values = dataMeans, free = T, labels = meansLabels),
mxFIMLObjective(covariance = "expCov", means = "expMean", dimnames = manifests),
mxData(theData, type = "raw")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment