Consider the data:
i | xi | yi |
---|---|---|
1 | 1 | 2 |
2 | 2 | 0 |
3 | 3 | 0 |
4 | 4 | 1 |
Find a polynomial such that is minimized.
For any given data set and the straight line , the key observation here is that
With
we are looking for appropriate to minimize . This is a least square problem, and we know that the answer is .
Let
Then the answer is
Thus, is the polynomial that best describes the data. One may use desmos to plot the function to see if it is close to the data points.
This note can be found at Course website > Learning resources.