[R] gnls() and "L-BFGS-B" in library(nlme)

Philipp Grueber philipp.grueber at ebs.edu
Thu Aug 8 12:56:19 CEST 2013


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.



More information about the R-help mailing list