[R-sig-ME] lower and upper bounds for optimizer="nloptwrap"

Andras Farkas motyoc@k@ @end|ng |rom y@hoo@com
Thu Apr 7 19:18:35 CEST 2022


Hello,

wonder if I could get some help on how to specify lower and upper bounds for optimizer="nloptwrap". To date my approach looks like:


lmercontrollist<-lmerControl(optimizer = "nloptwrap",
                             restart_edge = TRUE,
                             boundary.tol = 1e-5,
                             calc.derivs = TRUE,
                             use.last.params = FALSE,
                             sparseX = FALSE,
                             standardize.X = FALSE,
                             ## input checking options
                             check.nobs.vs.rankZ = "ignore",
                             check.nobs.vs.nlev = "stop",
                             check.nlev.gtreq.5 = "ignore",
                             check.nlev.gtr.1 = "stop",
                             check.nobs.vs.nRE= "stop",
                             check.rankX = c("message+drop.cols", "silent.drop.cols", "warn+drop.cols",
                                             "stop.deficient", "ignore"),
                             check.scaleX = c("warning","stop","silent.rescale",
                                              "message+rescale","warn+rescale","ignore"),
                             check.formula.LHS = "stop",
                             ## convergence checking options
                             check.conv.grad     = .makeCC("warning", tol = 2e-3, relTol = NULL),
                             check.conv.singular = .makeCC(action = "message", tol = formals(isSingular)$tol),
                             check.conv.hess     = .makeCC(action = "warning", tol = 1e-6),
                             ## optimizer args
                             optCtrl = list(maxeval=100,lower = rep.int(0, 21),upper = rep.int(5, 21)),
                             mod.type = "lmer")

let us ignore model appropriateness here and just focus on the constraints: 

m1 <- lmer(Reaction ~ Days + Subject+ (1|Days),data=sleepstudy,verbose=1,control =lmercontrollist)
summary(m1)


 as you will see the fixed effect values are negative. I also tried lb and ub instead of lower and upper based on nloptr function, but also did not help. Besides, just to be sure I understand correctly, the length of the lower/upper bounds must be the same as the length of fixed and random effect, correct? here I set to 21 based on output but am not exactly sure if the residual has to be included in the count or not...

much appreciate your help,

Andras 



More information about the R-sig-mixed-models mailing list