There seems to be two issues in using omxSetParameters to reset bounds. Please see below.
rm(list=ls());
require(OpenMx)
A<-mxMatrix(type="Full",nrow=1,ncol=1,free=T,values=.8,label="a",lbound=0,name="A");
model<-mxModel("model",A,mxAlgebra(A^2,name="A2"),mxAlgebraObjective("A2"))
Now I would like to remove the lower bound
model0<-omxSetParameters(model,"a",lbound=NA)
This gives an error: " 'lbound' argument must either be NA or a numeric vector. "
But I was using NA exactly.
model0<-omxSetParameters(model,"a",lbound=NaN)
model0@matrices$A
This time the reset is successful, though the previous error message suggests using NA.
mxRun(model0)
The minimization is not successful. You can check the estimate.
There is a warning saying: "In model 'model' NPSOL returned a non-zero status code 9. An input parameter ### was invalid "
A question: If I simply use -Inf instead of NaN, the reset is also successful, but the state of the model is different from one where the lbound is not set. Would there be numerical issues?
Thanks.
Hao