I have an ensemble of data points $(x_i,y_i)$ and I need to fit them according to $y=F(a,b,x)$ if $x \leq x_{ref}$ and $y=G(c,d,x)$ if $x \geq x_{ref}$. The parameters I need to adjust are then $a,b,c,d,x_{ref}$. Models $F$ and $G$ are nonlinear with respect to the parameters.
For sure, if I select $x_{ref}$ among the $x_i$, I can run separate curve fits, add the sum of squares and change $i$ until I find a minimum.
Is there any way
- to automate this procedure with Mathematica (this would provide the best values of $a,b,c,d$ for the best $x_{ref}$ selected among the $x_i$)
- perform in a second step the full regression
Any help will be appreciated.