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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With