Question: Solve the Problem A&B as handwriting, C&D by MATLAB 1.5 [Bec14] Generate 50 points {(xi, yi), i = 1, 2, ..., 50} by MATLAB: randn
Solve the Problem A&B as handwriting, C&D by MATLAB
![Solve the Problem A&B as handwriting, C&D by MATLAB 1.5 [Bec14] Generate](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f38cddc023e_34166f38cdd445d4.jpg)
1.5 [Bec14] Generate 50 points {(xi, yi), i = 1, 2, ..., 50} by MATLAB: randn ('state', 26) x = linspace (0,1,50); y = 1.8*x.^2 - 2.7*x + 1 + 0.06*randn (size (x)); Find the quadratic function y=ax? +bx+c that best fits these points in the least squares sense. That is, the averaged L2-error of the prediction made by the optimized quadratic model is minimized. Specifically, do the following: (a) Formulate the problem at hand as an unconstrained optimization problem with respect to the model's parameters {a, b,c}, where the averaged L2-error of the quadratic prediction defined by 1 e 50 so (yperdiet y.)" with y predict = ax + bx +c is minimized. To earn credits, it is required that the problem is formulaed in the standard form as minimize f(w) W with both w and f(w) defined explicitly. (b) Deduce a closed-form solution for the problem from part (a). (c) Compute the averaged L2 error at the optimal solution. (d) Display the 50 data points together with the optimized quadratic function in a single figure
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
