Question: Question: [13 points] Note: Do not use MATLAB build-in functions for regression. (a) Write a MATLAB function that accepts n values of x and y,

 Question: [13 points] Note: Do not use MATLAB build-in functions for

Question: [13 points] Note: Do not use MATLAB build-in functions for regression. (a) Write a MATLAB function that accepts n values of x and y, perform Linear Regression and returns values of and, the model parameters ao and a1 (b) Write another MATLAB function that accepts values of x and y (provided as arrays), checks for Linear, Power and Saturation growth-rate models, and estimate the values of parameters ao and a1 (or and , whichever is applicable). In all three methods, the function should use the function developed in part (a) to perform the linear regression part. Plot the data and the three models (one linear and two non-linear) on the same graph (use distinct colors/shades of lines to differentiate). The function should return a number from 1-3 indicating the model with the best fit, its , and the estimated values of parameters. Call the function from the command window with the data given below, capture the image of the output showing the returned values, and the graph, and include these in the Word document for submission. x10.75 234 8 8.5 y1.2 .95 2 2.424 2.7 2.6 uestion 2: [7 points] Write a MATLAB function that accepts (n+1) values of x and y,, fits nth order polynomial, evaluate it for certain x value using Lagrange Interpolating Polynomial, and returns the value of y at x Call this function from the command window with the data given in Question 1, evaluate y at x7, and capture the image of the output Refer to Figure 18.11 for the Pseudocode of the method. Question: [13 points] Note: Do not use MATLAB build-in functions for regression. (a) Write a MATLAB function that accepts n values of x and y, perform Linear Regression and returns values of and, the model parameters ao and a1 (b) Write another MATLAB function that accepts values of x and y (provided as arrays), checks for Linear, Power and Saturation growth-rate models, and estimate the values of parameters ao and a1 (or and , whichever is applicable). In all three methods, the function should use the function developed in part (a) to perform the linear regression part. Plot the data and the three models (one linear and two non-linear) on the same graph (use distinct colors/shades of lines to differentiate). The function should return a number from 1-3 indicating the model with the best fit, its , and the estimated values of parameters. Call the function from the command window with the data given below, capture the image of the output showing the returned values, and the graph, and include these in the Word document for submission. x10.75 234 8 8.5 y1.2 .95 2 2.424 2.7 2.6 uestion 2: [7 points] Write a MATLAB function that accepts (n+1) values of x and y,, fits nth order polynomial, evaluate it for certain x value using Lagrange Interpolating Polynomial, and returns the value of y at x Call this function from the command window with the data given in Question 1, evaluate y at x7, and capture the image of the output Refer to Figure 18.11 for the Pseudocode of the method

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 Databases Questions!