# How is interpolation related to the concept of regression?

Explain briefly What is meant by interpolation.How is it related to the concept of regression?

interpolation is art of reading between the lines of a table and in elementary mathematics the term usually denotes the process of computing the intermediate values of a function from a set of given or tabular values of that function.

-
Regression aims at identifying a function to describe the expected value of $Y$ (the dependent variable) given $X$ (the independent variables). Interpolation uses regression for predicting the value of $Y$ at given values of $X$. The difference is subtle but comes to the fore in models where the $Y$'s are correlated, because then the predicted values typically differ from their regression values. Neither regression nor prediction apply directly to interpolating in mathematical tables, which usually are assumed to have no random error, but their algorithms can still be used. –  whuber Sep 16 at 15:04

The main difference between interpolation and regression, is the definition of the problem they solve.

Given $n$ data points, when you interpolate, you look for a function that is of some predefined form that has the values in that points exactly as specified. That means given pairs $(x_i, y_i)$ you look for $F$ of some predefined form that satisfies $F(x_i) = y_i$. I think most commonly $F$ is chosen to be polynomial, spline (low degree polynomials on intervals between given points).

When you do regression, you look for a function that minimizes some cost, usually sum of squares of errors. You don't require the function to have the exact values at given points, you just want a good aproximation. In general, your found function $F$ might not satisfy $F(x_i) = y_i$ for any data point, but the cost function, i.e $\sum_{i=1}^n (F(x_i) - y_i)^2$ will be the smallest possible of all the functions of given form.

A good example for why you might want to only aproximate instead of interpolate are prizes on stock market. You can take prizes in some $k$ recent units of time, and try to interpolate them to get some prediction of the prize in the next unit of time. This is rather a bad idea, because there is no reason to think that the relations between the prizes can be exactly expressed by a polynomial. But linear regression might do the trick, since the prizes might have some "slope" and a linear function might be a good aproximation, at least locally (hint: it's not that easy, but regression is definately a better idea than interpolation in this case).

-

Hopefully this will come rather quickly with a simple example and visualization.

Suppose you have the following data:

X  Y
1  6
10 15
20 25
30 35
40 45
50 55


We may use regression to model Y as a response to X. Using R:  lm(y ~ x)

The results are an intercept of 5, and a coefficent for x of 1. Which means an arbitrary Y can be calculated for a given X as X + 5. As a picture, you can see this this way:

Notice how if you went to the X axis, anywhere along it, and drew a line up to the fitted line, and then drew a line over to the Y axis, you can get a value, whether or not I provided a value point for Y. Regression is smoothing over areas with no data by estimating the underlying relationship.

-