Question 13 Points Note Use Matlab Build Functions Regression Write Matlab Function Accept Q35651154

Question: [13 points] Note: Do not use MATLAB build-in functions for regression. (a) Write a MATLAB function that accepts n vQuestion: [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. Show transcribed image text 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.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *