(1) To find the curve that passes through a set of given points, you can use any method of interpolation, see the following link for farther information:
(2) To find the quadratic polynomial that has the least deviation from a set of points or from a curve then you can use the least squares polynomial of degree 2: y = ax2 ± bx ± c, for farther information, see
(1) To find the curve that passes through a set of given points, you can use any method of interpolation, see the following link for farther information:
(2) To find the quadratic polynomial that has the least deviation from a set of points or from a curve then you can use the least squares polynomial of degree 2: y = ax2 ± bx ± c, for farther information, see
It's not always obvious. Different functions have different shaped curves- quadratics (such as the function with ax^2 as its leading term which you mentioned), cubics (where the leading term is ax^3) and so on. Mathematica -an expensive program but a good one- has a good 'curve fitting' program - there are many out there. I agree with Fulvio when he noted that finding the 'best fit does not always provided a scientific basis for the behavior....' etc. In mathematics we are plotting infinite abstract points for a function on the real number line (or in the complex plane. For example, two different curve functions may overlap for a subset of the domain of the function and look like they fit your data points while being very different for other regions. Data points are often very small subsets - if you have large numbers of data points closely spaced, and you limit the domain of the function to that of the data points, you will at least describe the curve you see with mathematical accuracy.
Very probably the best way is to use a polynomial quadratic regression, as suggested by the equation reported in the reply of Abedallah M Rababah ,·which I endorse, or also a cubic polynomial regression, which increases the fitting but decreases the level of the probability significance (p)
Your two questions are actually mutually exclusive. 1) If you have n datapoints and if you really want the best matching curve you take a polynomial of a degree n-1 and apply any datafitting technique to it (least squares for instance, available in Matlab with the command polyfit). In this way it will fit EXACTLY all your datapoints. 2) If you want a quadratic polynomial, also apply least squares but specifying that you want a second degree polynomial. The quality of your result will be given by the Root Mean Square Error (RMSE).