arkottke
arkottke

Reputation: 567

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?

Upvotes: 4

Views: 1937

Answers (3)

Stefan Avey
Stefan Avey

Reputation: 1198

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.

Upvotes: 2

Aaron - mostly inactive
Aaron - mostly inactive

Reputation: 37764

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.

Upvotes: 2

Stat-R
Stat-R

Reputation: 5270

You can have upper and lower bounds for estimates in a mixed-effects regression in R. R has a rich resource on mixed model analysis. This link explains mixed-model concepts as well as provides R code step by step using nlme.

You may also refer to this post for constrained optimization using nlme.

Upvotes: 1

Related Questions