Question: Question 1: (13 points] Note: Do not use MATLAB build-in functions for regression. (a) Write a MATLAB function that accepts n values of x, and
Question 1: (13 points] Note: Do not use MATLAB build-in functions for regression. (a) Write a MATLAB function that accepts n values of x, and yi, perform Linear Regression and returns values of r and, the model parameters ao and a, (b) Write another MATLAB function that accepts n 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 ai (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 returm a number from 1-3 indicating the model with the best fit, its r, 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. 3 4 88.5 1.2 1.95 2 2.4 2.4 27 2.6 x 1 0.752
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
