There are some methods to do curve fitting using linear and non-linear methods. These methods approximate data points by a function. but how can we approximate our data points by using multiple functions which are continuous at junctions?

My data-set has a decreasing trend. I need to approximate it by using two reciprocal functions, f1(x) [x form 'a' to 'b'] and f2(x) [x from 'b' to 'c'], and Also I need C1 or C2 Continuity at b. Is there any hope?

Also i don`t want to use B-Spline because i need Ordinary Least Square instead of Total Least Square.

| cite | improve this question | | | | |
  • $\begingroup$ You could use linear regression over each interval? $\endgroup$ – TSF Aug 5 '16 at 23:07
  • $\begingroup$ can you share your data and the intervals? $\endgroup$ – msm Aug 5 '16 at 23:24
  • $\begingroup$ Tony, I need C1 or C2 Continuity at b. $\endgroup$ – Ehsan Mirsaeedi Aug 6 '16 at 4:55

I tell you here what I do when facing this problem (which is not uncommon.

If you know that for $a \leq x \leq b$, you have to use $f_1(x)$ and that for $b \leq x \leq c$, you have to use $f_2(x)$, then standard linear or nonlinear regression will provide the parameters for each of the functions; this is a starting point.

Now, the problem is the continuity at $x=b$. This can correspond to different conditions, the simplest being $f_1(b)=f_2(b)$ and $f'_1(b)=f'_2(b)$ (but we could also require $f''_1(b)=f''_2(b)$).

To solve the problem, I use optimization with equality constraint(s), the objective function being the sum of the squared errors. The starting values of the parameters being given by the preliminary regressions without constraints.

For sure, the problem is more difficult is $b$ is to be determined too.

If you wish, send me a typical problem of yours (my e-mail address is in my profile).

| cite | improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.