See this minimal working example.
library(OpenMx)
data(demoOneFactor)
# ===============================
# = Make and run a 1-factor CFA =
# ===============================
latents = c("G") # the latent factor
manifests = names(demoOneFactor) # manifest variables to be modeled
# ====================
# = Make the MxModel =
# ====================
m1 <- mxModel("One Factor", type = "RAM",
manifestVars = manifests, latentVars = latents,
mxPath(from = latents, to = manifests),
mxPath(from = manifests, arrows = 2),
mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0),
mxData(cov(demoOneFactor), type = "cov", numObs = 500),
mxCI("bob") # reference to entity not in model!
)
# ===============================
# = mxRun it and get a summary! =
# ===============================
m1 = mxRun(m1)
# Error in free[i, j] : subscript out of bounds
# should be unknown reference detected
See also, http://openmx.psyc.virginia.edu/thread/4109
#1
Fixed with https://github.com/OpenMx/OpenMx/commit/e5ac735731df7ea5b249b2734f22d895b2da2930
The memory-saving @free and @labels being 1x1 matrices broke the search for references in the confidence interval helper. It would try to search all the rows and columns of the full object even when the free and labels were only 1x1.
Instead of using the $, I could use the nrow and ncol of free. This would search faster.
Log in or register to post comments
#2
Now using the non-$ search.
https://github.com/OpenMx/OpenMx/commit/9149eafaee070924102865ff31f6ceeeafee42a7
Log in or register to post comments