Re: [R] Non-linear minimization

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Wed 09 Mar 2005 - 00:53:43 EST

Sébastien Ballesteros wrote:
> hello, I have got some trouble with R functions nlm(),
> nls() or optim() : I would like to fit 3 parameters
> which must stay in a precise interval. For exemple
> with nlm() :
>
> fn<-function(p) sum((dN-estdata(p[1],p[2],p[3]))^2)
> out<-nlm(fn, p=c(4, 17, 5),
> hessian=TRUE,print.level=2)
>
> with estdata() a function which returns value to fit
> with dN (observed data vactor)
>
> My problem is that only optim() allows me to set
> parameters interval with "L-BFGS-B" method but this
> one doesn't work in my case.
>
> I have heard about nls2 package (www.inra.fr/bia) but
> it doesn't work on Windows.

"it doesn't work on Windows" is a very gentle description in this particular case...

> Do you know any solutions

A typical trick is to redefine the function so that for points outside the boundaries increasing penalties are added (if you know enough about your function).

Uwe Ligges

> Thank's a lot for reading my post
>
> Best regards
>
> Sebastien
> INA P-G ecology dpt
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 09 01:00:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:41 EST