Curve fitting is the way we model or represent a data spread by assigning a ‘best fit‘ function (curve) along the entire range. Ideally, it will capture the trend in the data and allow us to make predictions of how the data series will behave in the future.
Types of curve fitting include:
- Interpolation, where you discover a function that is an exact fit to the data points. Since this assumes no measurement error, it has limited applicability to real life scenarios.
- Smoothing is when we find a function that is an approximate fit to the data points, but we give room for error and we allow our actual points to be near, but not necessarily on the line; given the error is minimized overall.
Linear and Polynomial Curve Fitting
Linear curve fitting, or linear regression, is when the data is fit to a straight line. Although there might be some curve to your data, a straight line provides a reasonable enough fit to make predictions. Since the equation of a generic straight line is always given by f(x)= a x + b, the question becomes: what a and b will give us the best fit line for our data?
Considering the vertical distance from each point to a prospective line as an error, and summing them up over our range, gives us a concrete number that expresses how far from ‘best’ the prospective line is.
A line that provides a minimum error can be considered the best straight line.
Since it’s the distance from our points to the line we’re interested in—whether it is positive or negative distance is not relevant—we square the distance in our error calculations. This also allows us to weight greater errors more heavily. So this method is called the least squares approach.
Polynomial curve fitting is when we fit our data to the graph of a polynomial function. The same least squares method can be used to find the polynomial, of a given degree, that has a minimum total error.
- Husch, Lawrence. Visual Calculus: Curve Fitting. Retrieved from http://archives.math.utk.edu/visual.calculus/0/curve_fit.5/index.html on May 13, 2018
- Gurley. Numerical Methods Lecture 5– Curve Fitting Techniques. CGN 3421 Lecture Notes. Retrieved from http://web.iitd.ac.in/~pmvs/courses/mel705/curvefitting.pdf on May 13, 2018
- Collum, David. Introduction to Curve Fitting. Retrieved from http://collum.chem.cornell.edu/documents/Intro_Curve_Fitting.pdf on May 13, 2018.
- KaleidaGraph. The KaleidaGraph Guide to Curve Fitting. Retrieved from http://www.synergy.com/Tools/curvefitting.pdf on May 13, 2018.
Confused and have questions? Head over to Chegg and use code “CS5OFFBTS18” (exp. 11/30/2018) to get $5 off your first month of Chegg Study, so you can understand any concept by asking a subject expert and getting an in-depth explanation online 24/7.
Comments? Need to post a correction? Please post a comment on our Facebook page.