Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limits on NLME regression?

I am currently using nlme to perform mixed-effects regression.

I would like to perform constrained optimization by providing upper and lower bounds to the parameters within the call to nlme.

Is this possible?

like image 566
arkottke Avatar asked Oct 31 '25 00:10

arkottke


2 Answers

If you define your upper bounds as a vector upper_bounds of the same length as the vector passed to the start argument of nlme, then you can set the upper bounds via nlmeControl():

nlme(..., control = nlmeControl(opt = "nlminb", upper = upper_bounds))

This may not have been possible when the question was asked but it works in nlme version 3.1.137.

like image 166
Stefan Avey Avatar answered Nov 02 '25 13:11

Stefan Avey


Here are two easy ways, without messing with nlme parameters: 1) fit a set of models on your boundaries and choose the model with the best fit, and 2) use a transformed version of your parameter that maps the reals to your desired interval.

like image 44
Aaron left Stack Overflow Avatar answered Nov 02 '25 13:11

Aaron left Stack Overflow