Dear R Users,

I attempt to estimate a generalized nonlinear least squares model using
gnls() from the nlme library.

I wish to restrict some of my parameters using the "L-BFGS-B" method for the
"optim" optimizer. However, in contrast to nls() in the same package, gnls()
does not accept any `lower' or `upper' argument, nor does the control
argument allow for such elements. Unfortunately, the help file does not
provide a description of how to include lower or upper bounds, nor did I
find any hint in the internet.

Example
library(nlme)
#works but no restriction included
fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean,
start=c(Asym=17,xmid=50,scal=7),weights =
varPower(),control=gnlsControl(opt="optim",optimMethod="L-BFGS-B"))
summary(fm1)

#does not work
fm2 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal),
Soybean,start=c(Asym=17,xmid=50,scal=7), weights =
varPower(),control=gnlsControl(opt="optim",optimMethod="L-BFGS-B"),lower=c(0,0,0),upper=c(100,100,100))
summary(fm2)

fm3 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal),
Soybean,start=c(Asym=17,xmid=50,scal=7),lower=c(0,0,0),upper=c(100,100,100),
weights =
varPower(),control=gnlsControl(opt="optim",optimMethod="L-BFGS-B"))
summary(fm3)

Do you know a way to include lower and upper bounds? And: How do I restrict
only selected parameters while I wish others to take any value.

Any hints pointing to a solution are highly appreciated. 

Regards,
Philipp Grueber 



-----
____________________________________
EBS Universitaet fuer Wirtschaft und Recht
FARE Department
Wiesbaden/ Germany
http://www.ebs.edu/index.php?id=finacc&L=0
--
View this message in context: 
http://r.789695.n4.nabble.com/gnls-and-L-BFGS-B-in-library-nlme-tp4673341.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to