Question: Given the data below with x as the independent variable and y as the dependent variable: x 5 1 0 1 5 2 0 2

Given the data below with x as the independent variable and y as the
dependent variable:
x 5101520253035404550
y 17243133373740404241
(a) Use least-squares regression to fit (i) a straight line, and (ii) a parabola without
using polyfit()/polyval() in MATLAB or trendline in Excel (you can use
MATLAB/Excel to calculate sums, inverses etc.).
(b) Plot the given data and the best-fits in two separate graphs (one for linear fit and the other for quadratic fit) in either MATLAB or Excel without using
polyfit()/polyval() in MATLAB or trendline in Excel
(c) Calculate the r2 value for each fit and determine the superior fit between the two. Is the other one a good enough fit? Typically a 95% reduction in the error/uncertainty in data with respect to the mean can be used to determine whether a fit is good enough.
Submit relevant MATLAB/Excel printouts along with any hand calculations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Civil Engineering Questions!