What is the right function family to fit these curves?

51 Views Asked by At

I have a bunch of data that im trying to fit but I cant find the right function family. Its like a big V with a curved bottom and linear sides. The function family should be able to fit all of the data below. data_graph

The fit above was an auto fit with a parabola. As you can see the ends of the data are more linear than the ends of the parabola. The fit below is a manual fit with the function sec^2. Its hard to do auto fit with sec^2 because its non-continuous. The fit is similar to the parabola: the ends of the sec^2 function are more curved than the data. The data was not generated by a computer, but it should still be pretty accurate. Thats why I'm pretty sure there is a better function family out there considering these functions dont look perfect. sec squared

1

There are 1 best solutions below

0
On BEST ANSWER

If the ends get linear, you can try to fit against a hyperbola

$$h(x) = a\sqrt{b^2+(x-x_0)^2}+c$$

  • For large $x$, the function behaves like $$h(x)\approx a|x-x_0|+c$$ thus linear with slope $-a$ for large negative $x$ and slope $a$ for large positive $x$.

  • The two linear asymptotes meet at $(x_0, c)$, so you can determine $c$ graphically provided you have enough of the graph available.

  • The vertical symmetry axis is $x=x_0$.

  • The apex (minimum for $a>0$ resp. maximum if $a<0$) is at $(x_0, y_0)$ with $y_0=a|b|+c$.

  • The parabola that's asymptote at the apex has equation $$x\mapsto \frac{a}{2|b|}(x-x_0)^2+y_0$$

  • The circle that's asymptote at the apex has radius $|b/a|$, so this quantity can also be determined graphically.

  • If you have already determined $a$ and the apex $(x_0,y_0)$, then $h$ is a 1-dimensional family of curves where $b$ and $c$ are related by $y_0=a|b|+c$.


Addendum: One degree of freedom can easily be added by using exponents other than 2: Let $b>0$ without loss of generalty, then use $$h(x) = a\big(b^w+|x-x_0|^w\big)^{1/w}+c$$ where $w=2$ is the case of a hyperbola from above. The formula for apex and the linear asymptotes as $x\to\pm\infty$ stay the same.