Use Matlab and write entier script
Problem 2.
Generate the estimate (linear estimate) for y_est, and plot(x ,y_est).
Use “hold on†and plot(x,y) and plot(x,y_est), so that you cansee the result of the line and how it fits the data.  Does it look like it did a pretty good job?
An estimate of the “residual error†is the sum of the squares ofthe difference between y and y_est.
This is often denoted as r2.
r2 = sum( (y – y_est) .^2)
or equivalently
r2 = sum( (y – y_est)’ * (y – y_est)’)
What is the residual error for the above problem?