Skip to content

Propositions to fit a 2 pieces function

2 messages · Eric Rodriguez, Uwe Ligges

#
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 ?

Thanks a lot !

Eric
#
Eric Rodriguez wrote:

            
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