Distinguish not run from modified since run?

Hi,
Doing summary on a model that has not been run gives the warning
"WARNING: This model was modified since it was run. Summary information may be out-of-date."

Be nice if we could distinguish never run from modified since run... and, in this case say

"WARNING: This model has not been run. tip: Use
model = mxRun(model)
to estimate a model."


library(OpenMx)
# generate data
covData <- matrix(c(1.0, 0.5, 0.5, 1.0), nrow = 2, dimnames = list(c("a", "b"), c("a", "b")))

# Specify the model
m1 <- mxModel("CI_Example",

mxCI(..., remove = TRUE)

Currently users can't remove CIs from models, only add them. Given they can take hours to compute, this can be a hassle.

One way would be to make things like this work:


model$intervals = NULL
model$intervals = model$intervals[-3]

An aid to learning would be to add a note to the help about remove = TRUE parameter to mxModel(), which would remove a CI of that name from the model.


newModel = mxModel(oldModel, mxCI("a_r1_c1"), remove = TRUE)

remove interval (CI requests) with model$intervals = NULL

model$intervals = NULL

doesn't error, but it does nothing (the interval requests remain)

model@intervals = NULL
fails with an error:
Error in checkAtAssignment("MxModel", "intervals", "NULL") :
assignment of an object of class “NULL” is not valid for @‘intervals’ in an object of class “MxModel”;

It would be nice if the $ operator allowed removing CI requests from models.

CIs: Progress bar, and start close to fail point using 1.96*SE?

Hi,
Sitting watching R computing a pretty simple set of CIs for the last 4 hrs, and with no progress-bar feedback...

I wonder:
1. Why don't we use the cheap SEs from the 2nd derivative matrix to seed the starts for CI computation? What would be wrong with that?
2. Even with variance in how long it takes per CI, something like this would be helpful to the user:


nCI <- length(CIs) # actually want this in cells, so unpack matrices, rows etc into vector of cell addresses)
# create progress bar

pbar = txtProgressBar(min = 0, max = nCI, style = 3)

for(i in 1:nCI) {

Standard Errors reported as NA for identified model when N=5000 but not N=500 nor N=50

In many different, complicated, models, I have found Standard Errors to return as NA. Here is a simple example! Changing N to something smaller yields sensible-looking SE's. With 5000, where the SE's should be small but not minuscule (this is ordinal data) we get a lot of NA's.


free parameters:
name matrix row col Estimate Std.Error lbound ubound
1 thresholdModel.L[1,1] L 1 1 0.6910161 NA -0.99 0.99

Bug in multigroup omxSaturatedModel()


require(OpenMx)
data(demoOneFactor)
latents = c("G")
manifests = names(demoOneFactor)

# 1. Make two models, and nest them in a multigroup
m1 <- mxModel("model1", type = "RAM",
manifestVars = manifests, latentVars = latents,
mxPath(from = latents, to = manifests),
mxPath(from = manifests, arrows = 2),
mxPath(from = latents, arrows = 2, free = F, values = 1.0),
mxData(cov(demoOneFactor), type = "cov", numObs = 500)
)

m2 <- m1
m2 <- mxRename(m2, 'model2')

# 2. Nest them in a multigroup supermodel and run

Hessian wrong for R fit function

For an R fit function example, the Hessian comes back all zeros. I found this from thread http://openmx.psyc.virginia.edu/thread/2230


#------------------------------------------------
set.seed(135)
nobs <- 13
adat <- data.frame(x=rnorm(nobs))

dmod <- mxModel(
name='I will run fast on OpenMx',
mxMatrix(name='A', nrow=nobs, ncol=1, free=T, values=0.1),
mxMatrix(name='X', nrow=nobs, ncol=1, free=F, values=as.matrix(adat)),
mxAlgebra((X-A) %^% 2, name='Row'),
mxAlgebra(sum(Row), name='Red'),
mxFitFunctionAlgebra('Red')
)

Optimality tolerance

This is an issue that has been around a while--since version 1.3.2, at least. I have seen it under Windows and Linux. There are two components of Mx options called "Optimality tolerance", each having a slightly different default value. You can see for yourself with options()$mxOption . This is problematic because there is no way to set the option to a different value:

> factorModel <- mxOption(factorModel,"Optimality tolerance", 6.3e-11)
Error in optionsNames[[match]] : attempt to select more than one element
> mxOption(NULL,"Optimality tolerance", 6.3e-11)