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)

mxOption(m1, "Default optimizer", "NPSOL") not setting optimizer?

Hi,
I was expecting this to set the optimizer for a model:


# Set optimizer for this model
m1 = mxRun(mxOption(m1, "Default optimizer", "NPSOL"))

But

testthat::expect_match(m1@runstate$compute$steps[1][[1]]$engine, "NPSOL")
# Error: m1@runstate$compute$steps[1][[1]]$engine does not match 'NPSOL'. Actual value: "CSOLNP"

Is that a bug in me, mxOption(), or OpenMx?

worked examples


library(OpenMx)
manifests = c("mpg", "disp", "gear")
m1 <- mxModel("ind", type = "RAM",
manifestVars = manifests,
mxPath(from = manifests, arrows = 2),

Estimates don't move far enough from poor starts in CSOLNP

Hi, The current trunk of OpenMx (999.0.0-3521) seems to be not estimating parameters correctly.

I've uploaded a gist that shows the issues here: It's a simple independence model with 3 variables in the built-in mtcars data set.

https://gist.github.com/tbates/d2261e8c5daf426e1c8e

You can see that the means are borderline OK, but the variances are way off.


# ===================================
# = Means and variances in the data =
# ===================================
round(diag(cov(mtcars[,manifests])),2)
mpg disp gear
36.32 15360.80 0.54

summary() contents in 2.0

Good to think about what 2.0 will show in summary()?

With a goal of surfacing the almost-always wanted top-level detail for the user, and not showing things that are obtained elsewhere or are not summary data, then 4 elements that can perhaps be dropped are:
1. compute plan
2. data
3. timestamp
4. OpenMx version

Then perhaps a line of text beneath the summary saying:

"See help(OpenMx_Output) for examples of how to easily access expected and obtained data summarys, elapsed time, packageVersion("OpenMx"), the compute plan and more." [1]

warning 1: In `$.data.frame`(params, lbound) : Name partially matched in data frame

In packageVersion("OpenMx") # [1] ‘999.0.0.3474’
summary on this model (and others) dumps a warning message and leaves fit statistics empty. the warning on summary() is:

Warning messages:
1: In `$.data.frame`(params, lbound) :
Name partially matched in data frame
2: In `$.data.frame`(params, ubound) :
Name partially matched in data frame

v1_6 = paste0("v",1:6) # [1] "v1" "v2" "v3" "v4" "v5" "v6"
x1_2 = c("x1", "x2")

covData <- matrix(nrow=6, ncol=6, byrow=TRUE, dimnames=list(v1_6, v1_6),
data = c(0.9223099, 0.1862938, 0.4374359, 0.8959973, 0.9928430, 0.5320662,

Memory leak(?) when running a RAM model with a constraint.

I found this bug when I was thinking about adding a test to be sure that mxStandardizeRAMpaths() behaves properly when the model contains an mxConstraint statement. The attached R script causes R to lock up and steadily take up more and more memory until it crashes. Sometimes, R displays a message to the console about std::bad_alloc before the window closes, but not always.

Confidence intervals do not agree with estimates! Should not happen


free parameters:
name matrix row col Estimate Std.Error lbound ubound
1 b11 MZ.b 1 1 2.7536823 0.69611278
2 m1MZ MZ.meanMZ 1 1 20.6886950 0.16960595
3 m2MZ MZ.meanMZ 1 2 20.6934722 0.16988419
4 v1MZ MZ.expCovMZ bmi1 bmi1 0.7213571 0.04326283 1e-04
5 c21MZ MZ.expCovMZ bmi1 bmi2 0.5840681 0.04034537 0
6 v2MZ MZ.expCovMZ bmi2 bmi2 0.7842634 0.04713233 1e-04
7 m1DZ DZ.meanDZ 1 1 20.7833538 0.17188984