In this exercise you will use least-squares curve fitting to develop two equatio
ID: 3177093 • Letter: I
Question
In this exercise you will use least-squares curve fitting to develop two equations to model the data given. Using these equations, we will predict the function values for two inputs and evaluate the prediction made by each of the curves and linear interpolation.
PART A
Using the 8 non-shaded values above, find a0 and a1 for the least squares linear regression. We will save the shaded values for our test data, that is, data points that are known but we will not include in the information used to make a representative curve. We will use these points to see how close our curve fit is to predicting actual values that were not used to derive the curve. Compute the overall squared-error. Write the completed polynomial.
PART B
Using the 8 non-shaded values from part A, find a0, a1, and a2 for a parabolic least squares regression (polynomial of degree 2). Use MS Excel to solve for these coefficients. Compute the overall squared-error. Write the completed polynomial. Include a printout of your Excel spreadsheet.
PART C
On two separate graphs, plot the non-shaded data points and show the resulting curves from Part A and Part B; a separate graph for each curve. Use graph paper.
PART D
Fill in the following test table:
Which method(s) performed the best? Would you have expected the outcomes? How do these perform for these data points vs. the linear and parabolic curve’s squared errors? Discuss your answer.
PART E
In Part B you used Microsoft Excel to solve for the coefficients for parabolic least squares regression (polynomial of degree 2). Using Visual Basic to automate Microsoft Excel, create this Excel Spreadsheet. You will learn about this during the second week in problem-solving. Turn in a printout of this program.
xt I 11 16 21 26 31 38 43 48 53 35 40 44 46 Y 19 27 33 39 41 50Explanation / Answer
Solution:
Part A:
Using the 8 non-shaded values above, find a0 and a1 for the least squares linear regression. We will save the shaded values for our test data, that is, data points that are known but we will not include in the information used to make a representative curve. We will use these points to see how close our curve fit is to predicting actual values that were not used to derive the curve. Compute the overall squared-error. Write the completed polynomial.
n = 8 ( x) 2 = 52441
x = 229 mean of x = 28.625
y = 295 mean of y = 36.875
x y = 67555 x y = 9444
x2 = 8607
a1 = n xy - x y/ n x2 - ( x) 2
a1 = 8(9444) – (229)(295)/ 8(8607) – 52441
a1 = 0.4872
a0 = mean of y – (a1)(mean of x)
a0 = 36.875– (0.4872)( 28.625)
a0 = 22.9289
Least squares linear regression:
Y = 22.9289 + 0.4872X
Overall Squared Error = e 2 = (y – ao – a1x)2
= (yactual – y model)2
= (19 – 22.9289– 0.4872 (6))2 + (27 – 22.9289– 0.4872 (11))2 +(33 – 22.9289– 0.4872 (16))2 + (40 – 22.9289– 0.4872 (26))2 +(39 – 22.9289– 0.4872 (31))2 +(41 – 22.9289– 0.4872 (38))2 +(46 – 22.9289– 0.4872 (48))2 +(50 – 22.9289– 0.4872 (53))2
Overall Squared Error = 75.9773292
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.