[R] Propositions to fit a 2 pieces function

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Jan 31 12:58:30 CET 2005


Eric Rodriguez wrote:

> Hi,
> 
> I would like to have some advices about how to fit such function:
> 
> f(x) =  a.x^b                      if x <= t
>           c.x - c.t + a.t^b       otherwise
> 
> I have to minimize the least-squares error  knowing x and f(x).
> 
> Do you have any propositions of what should I use to achieve it ?

That's what ifelse() has been invented for.
Are you going to apply Nelder_Mead, BFGS or what? BFGS might be very 
problematic in this case (untested) ...

Uwe Ligges




> Thanks a lot !
> 
> Eric
> 
> ______________________________________________
> R-help at 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




More information about the R-help mailing list