Here's a test .rda file containing a model, along with an accompanying script to add a CI to this model, and estimate it with NPSOL and with CSOLNP
The behaviors are very different: NPSOL code reds on the model, but computes the CIs where they should be.
CSOLNP says everything is fine, but returns miniscule CIs - sometimes it's even out of order.
The direct link to the attached model is
https://openmx.ssri.psu.edu/sites/default/files/issues/m1.txt
mxVersion() OpenMx version: 2.0.0.3952 R version: R version 3.1.2 (2014-10-31) Platform: x86_64-apple-darwin13.4.0 Default optimiser: CSOLNP # ===================== # = Set opt to NPSOL = # ===================== mxOption(NULL, "Default optimizer", "NPSOL") # Add a CI, and estimate it... x = mxModel(m1, mxCI("DepressionII_with_heart_disease")) # NPSOL code reds, but the CI looks fine x = mxRun(x, intervals = T); summary(x)$CI # lbound estimate ubound note # DepressionII_with_heart_disease 0.1022891 0.1346589 0.1687101 # ==================== # = Switch optimizer = # ==================== mxOption(NULL, "Default optimizer", "CSOLNP") x = mxModel(m1, mxCI("DepressionII_with_heart_disease")) x = mxRun(x, intervals = T); summary(x)$CI # CSOLNP claims to run fine, but the CIs are near (but not quite) identical to each other and miles out. # DepressionII_with_heart_disease 0.1346571 0.1346638 0.1346748
Attachment | Size |
---|---|
m1.txt | 17.66 KB |
CSOLNP_CI_fail.R | 941 bytes |
Comments
#1
Please try with SLSQP
#2
built from git, but model says "engine SLSQP unknown"
#3
Version v2.1.0-38-ga48c723 is about a month old. Try with v2.1.0-182-g9331c69 or newer. I get,
This is wider than NPSOL. Something isn't right. I will investigate why.
#4
yeah. I get that now. We should mod mxVersion() to note the current Git version. I'd rebuilt, but R still had the old version in memory.
But yes also: those CIs are far too wide.
#5
Can you run this with SLSQP and look at x$output$computes[[2]] ? It should like roughly like this,
This will show where the other parameters moved during the profile likelihood optimization. See if anything looks out of bounds. I suspect you need some box constraints to keep things more reasonable.
#6
Fixed now: yay