Skip to main content

Interpolation and Curve Fitting

Interpolation

While performing an experiment or a survey, it is quite difficult to measure all the data points. Instead, we measure only a few data points and estimate the missing values between those points. This process of estimating values between the input data points is called interpolation.

In some cases, we need to estimate values outside of the range of data points. The process of estimating values outside of the input data points is called extrapolation.

Suppose, we took measurements of n+1n+1 data points from a real-life experiment as follows:

xx0x1...xnyy0y1...yn\begin{matrix} x & x_0 & x_1 & ... & x_n\\ y & y_0 & y_1 & ... & y_n \end{matrix}

If we know the exact relation y=f(x)y=f(x), then we can easily find the values of yy for any xx. But in most cases we don't know f(x)f(x) and need to approximate it with simpler functions.

In interpolation, we take a simpler function ϕ(x)\phi(x) whose curve passes through the input data points. This function will be exactly as f(x)f(x) at x0,x1,...,xnx_0, x_1, ..., x_n and will be approximate for other points. The function ϕ(x)\phi(x) which is used to approximate the values between the input data points is called the interpolating function.

If ϕ(x)\phi(x) is a polynomial function then the interpolation is called polynomial interpolation. The function ϕ(x)\phi(x) can also be a finite trigonometric series, an exponential function or any function. In this course, we will be focusing only on polynomial interpolation.

Curve Fitting

In curve fitting, we fix a prediction function and find the unknown coefficients by minimizing the error of prediction. The function can be of any kind like polynomial, exponential, logarithmic etc. We generally use the principle of least squares to find the unknown coefficients. In this principle, we minimize the sum of squares of errors between predicted points and input points.

Curve fitting doesn't guarantee that the curve of the prediction function will pass through all the input data points. It is used to find out the actual function that describes the relationship between input and output variables. An analyst may fit various curves/functions for the same data and take the one that minimizes both underfitting and overfitting of data.

Interpolation vs Curve Fitting

The following table lists the differences between interpolation and curve fitting.

InterpolationCurve Fitting
1. It estimates the missing points between the input data points.1. It finds the unknown coefficients of the prediction function by minimizing the error of prediction.
2. The interpolating polynomial will always pass through all the input data points.2. The curve obtained may not pass through the input data points.
3. It helps find missing data points.3. It helps find the relation between input and output variables.