[R-sig-ME] GLMM with bounded parameters

Pierre de Villemereuil pierre.de.villemereuil at mailoo.org
Fri Dec 16 13:32:10 CET 2016

Dear all,

I'm trying to fit a predictive bell curve on count data with Poisson noise 
around the curve. The idea is to estimate the optimum of fitness according to 
some trait.

The good news is that I don't need to resort to non-linear modelling to do 
that, because the exponential link combined with a polynomial formula can do 
the job as shown in the dummy example below:
x <- runif(300,0,10)
fitness <- rpois(300,10*dnorm(x,mean=5,sd=2))

mod = glm(fitness ~ x + I(x^2),family="poisson")
plot(fitness ~ x)
points(predict(mod,type="response") ~ x,col="red")

My problem is that I'd like to impose some constraints on the parameters to 
ensure that a bell-shape is fitted, e.g. that the parameter for x is positive 
and the parameter for I(x^2) is negative.

Is there a way to enforce such constraints in mixed models packages available 
in R? I'm currently using lme4, but I'm happy to switch to any other package.


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