I have some data and I want to fit a quadratic curve for my data But I don't know that how to it do? My data :
$x,y = 100,45;$
$x_1,y_1= 101, 50$;
$x_2,y_3=99,35$;
$\ldots$
For instance this website is fitting function very well http://mycurvefit.com/ But I don't know how ıt is work?What is the background?
How can I calculate mathematical way this function? Thank your advanced
So you want to fit your given points with the curve $ f(x) = a + b\,x + c\,x^{\,2} $. There are many "fitting" methods to choose from depending on considering the nature of the data and of the underlying error. I suppose you refer to the most common "least square" method (in the most common acception which assumes that the error is just on the $y$ coordinate).
Then the underlying mechanism of it is to calculate the total square error $$ E(a,b,c)^{\,2} = \sum\limits_k {\left( {y_{\,k} - f(x_{\,k} )} \right)^{\,2} } = \sum\limits_k {\left( {y_{\,k} - a - b\,x_{\,k} - c\,x_{\,k} ^{\,2} } \right)^{\,2} } $$ which depends on the unknown parameters $a,b,c$ and find for which value of them it becomes minimum. So (under proper assumptions concerning the data distribution ...which practically are assessed from a plot of the data) you are to solve the system $$ \left\{ \matrix{ 0 = {\partial \over {\partial \,a}}E(a,b,c)^{\,2} = - 2\sum\limits_k {\left( {y_{\,k} - a - b\,x_{\,k} - c\,x_{\,k} ^{\,2} } \right)} \hfill \cr 0 = {\partial \over {\partial \,b}}E(a,b,c)^{\,2} = - 2\sum\limits_k {x_{\,k} \left( {y_{\,k} - a - b\,x_{\,k} - c\,x_{\,k} ^{\,2} } \right)} \hfill \cr 0 = {\partial \over {\partial \,c}}E(a,b,c)^{\,2} = - 2\sum\limits_k {x_{\,k} ^{\,2} \left( {y_{\,k} - a - b\,x_{\,k} - c\,x_{\,k} ^{\,2} } \right)} \hfill \cr} \right. $$ This is finally a linear system in the unknowns $a,b,c$ which provides the solution, always given that the data distribution be actually "nearly quadratic".