1. Monomial least-squares (15 pts) Code. In the code, determine the least-squares estimation of a monomial of degree d using the n data [k, Yk] provided by the function. Plot the points and fitting function for the following (n, d) pairs: (5, 3), (10, 3), (10, 5). This means you need to run your code with n = 5 and d = 3 and plot it, then run it again for n = 10 and d = 3 and plot that, etc. Provide the results in the hard copy.
2. Harmonic least-squares (15 pts) Code. In the code, using the same data [, Y] created in Problem #1, continue the script code to perform a least-squares estimation using the harmonic function y = ao + a x + Asin(2x + θ). That is: compute the unknown variables [ao, a, A, θ]. Please plot and print out the points and fitting function for n = 10 and n = 15. Also report the values of the variables [ao, a1, A, θ]. Provide the results in the hard copy.