Created
June 27, 2014 14:12
-
-
Save tbates/e62c6a53943a69f2a5ea to your computer and use it in GitHub Desktop.
lbound = hard value?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data(myFADataRaw, package = "OpenMx") | |
latents = c("G") | |
manifests = names(myFADataRaw) | |
myFADataRaw = myFADataRaw[, manifests] | |
m1 <- mxModel("m1", type="RAM", manifestVars = manifests, latentVars = latents, | |
mxPath(from = latents, to = manifests, values = 0), | |
mxPath(from = manifests, arrows = 2), # manifest residuals | |
mxPath(from = latents, arrows = 2, free = F, values = 1), # latents fixed@1 | |
mxData(cov(myFADataRaw, use = "complete"), type = "cov", numObs = nrow(myFADataRaw)) | |
) | |
m1 = mxRun(m1) | |
summary(m1)$parameters[ ,c(1,5)] | |
m2 = mxModel(m1, name="bounded", mxPath(from = latents, to = manifests, values = 0, lbound = .1)) | |
m2 = mxRun(m2) | |
summary(m2)$parameters[ ,c(1,5)] | |
This is a CSOLNP bug.
add
cbind(summary(m2)$parameters[ ,c(1,5)], summary(m1)$parameters[ ,c(1,5)])
to the end
And try re-running with
mxOption(NULL, "Default optimizer", "NPSOL")
CSOLNP apparently does not yet move parameters inside their bounds before starting.
Cheers,
Mike Hunter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just CSOLNP ignore