In: Statistics and Probability
A set of data has the following coordinates
t | 0 | 1 | 3 | 4 | 7 |
y | 2 | 4 | 5 | 7 | 10 |
a) Find the least-squares fit to this data by a linear function of t (that is, find constants c1,c0 so that y(t) = c1t + c0 is the best linear fit to this set of data).
b) Find the equation of the best quadratic fit to the same set of data. Then find the equation of the polynomial of smallest degree that fits the data exactly.
The following data are provided:
X | Y |
0 | 2 |
1 | 4 |
3 | 5 |
4 | 7 |
7 | 10 |
The independent variable is X, and the dependent variable is Y. In order to compute the regression coefficients, the following table needs to be used:
X | Y | X*Y | X2 | Y2 | |
0 | 2 | 0 | 0 | 4 | |
1 | 4 | 4 | 1 | 16 | |
3 | 5 | 15 | 9 | 25 | |
4 | 7 | 28 | 16 | 49 | |
7 | 10 | 70 | 49 | 100 | |
Sum = | 15 | 28 | 117 | 75 | 194 |
Based on the above table, the following is calculated:
b)
I will be using excel and different polynomial graphs that will help decide the best quadratic fit to the same set of data:
Polynomial degree 3
Polynomial degree - 4 which is a perfect fit. Hence the equation becomes:
y = -0.0536x4 + 0.6786x3 - 2.5179x2 + 3.8929x + 2
with
R² = 1
Let me know in the comments if anything is not clear. I will reply ASAP! Please do upvote if satisfied!