[R] nlrob and robust nonlinear regression with upper and/or lower bounds on parameters

Shane McMahon shanemcmahon at wisc.edu
Fri Mar 15 15:57:02 CET 2013


I have a question regarding robust nonlinear regression with nlrob. I 
would like to place lower bounds on the parameters, but when I call 
nlrob with limits it returns the following error:

"Error in psi(resid/Scale, ...) : unused argument(s) (lower = list(Asym 
= 1, mid = 1, scal = 1))"

After consulting the documentation I noticed that upper and lower are 
not listed as parameter in the nlrob help documentation. I haven't 
checked the source to confirm this yet, but I infer that nlrob simply 
doesn't support upper and lower bounds.
For my current problem, I only require that the parameters be positive, 
so I simply rewrote the formula to be a function of the absolute value 
of the parameter. However, I have other problems where I am not so 
lucky. Are there robust nonlinear regression methods that support upper 
and lower bounds? Or am I simply missing something with nlrob? I've 
included example code that should illustrate the issue.

require(stats)
require(robustbase)
Dat <- NULL; Dat$x <- rep(1:25, 20)
set.seed(1)
Dat$y <- SSlogis(Dat$x, 10, 12, 2)*rnorm(500, 1, 0.1)
plot(Dat)
Dat.nls <- nls(y ~ SSlogis(x, Asym, mid, scal), 
data=Dat,start=list(Asym=1,mid=1,scal=1),lower=list(Asym=1,mid=1,scal=1)); 
Dat.nls
lines(1:25, predict(Dat.nls, newdata=list(x=1:25)), col=1)
Dat.nlrob <- nlrob(y ~ SSlogis(x, Asym, mid, scal), 
data=Dat,start=list(Asym=1,mid=1,scal=1)); Dat.nlrob
lines(1:25, predict(Dat.nlrob, newdata=list(x=1:25)), col=2)
Dat.nlrob <- nlrob(y ~ SSlogis(x, Asym, mid, scal), 
data=Dat,start=list(Asym=1,mid=1,scal=1),lower=list(Asym=1,mid=1,scal=1)); 
Dat.nlrob



thanks,
Shane



More information about the R-help mailing list