Question: solve using python numpy PLEASE DON'T USE CHATGPT THE ANSWER IS USELESS solve using numpy python PLEASE DONT USE CHATGPT There are 10 data points

solve using python numpy PLEASE DON'T USE CHATGPT THE ANSWER IS USELESS

solve using numpy python PLEASE DONT USE CHATGPT
There are 10 data points (x1,y1),(x2,y2),,(x10,y10) : Assume that the curve f(x) is defined by (a1,a2,a3) i.e. f(x)=a3x2+a2x1+a1. Here, we consider two fitting problem: (P1)mini=110yif(xi)s.t.a1,a2,a3:unrestricted. and (P2)mini=110(yif(xi))2s.t.a1,a2,a3:unrestricted. For the problem (P1), we reformulate it as follows mins.t.i=110ti+siyif(xi)=tisi,i=1,2,,10a1,a2,a3:unrestricted.ti0,i=1,2,,10si0,i=1,2,,10 (a) Build a py-file and use gurobi to solve the problem (P1). (b) Reformulate the problem (P2) as minzR3Azb2 by choosing suitable the vector z of decision variables, the matrix A and the right-hand-side vector b. Explain why z=(AtA)1Atb is an optimal solution. (c) Plot data points, the functions given in (a) and (b) by matplotlib (d) What is the difference between the functions obtained by comparing the two different methods? 5. There are 10 data points (x1,y1),(x2,y2),,(x10,y10) : Assume that the curve f(x) is defined by (a1,a2,a3) i.e. f(x)=a3x2+a2x1+a1. Here, we consider two fitting problem: (P1)mini=110yif(xi)s.t.a1,a2,a3:unrestricted. and (P2)mini=110(yif(xi))2s.t.a1,a2,a3:unrestricted. For the problem (P1), we reformulate it as follows mins.t.i=110ti+siyif(xi)=tisi,i=1,2,,10a1,a2,a3:unrestricted.ti0,i=1,2,,10si0,i=1,2,,10 (a) Build a py-file and use gurobi to solve the problem (P1). (b) Reformulate the problem (P2) as minzR3Azb2 by choosing suitable the vector z of decision variables, the matrix A and the right-hand-side vector b. Explain why z=(AtA)1Atb is an optimal solution. (c) Plot data points, the functions given in (a) and (b) by matplotlib (d) What is the difference between the functions obtained by comparing the two different methods? (e) Design an experiment for supporting the difference given in (d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
