Python/Matlab to find out least square error and to find out parabola which best fits the data
Budget: ₹600 – ₹700 INR
• You may NOT use any built-in fitting functions.
• You may use the following built-in linear solvers: Python: numpy.linalg.solve, Matlab: linsolve.
• In addition to your code, you must show the derivation of the equations you are solving.
A sensor records measurements ui at different instants ti . The data is stored as pairs of (t, u) in the
file data.dat . Read in the data and perform the following:
(a) Using Python or Matlab, plot the measurements at their corresponding time on a graph.
(b) Find the line that best fits the data and plot it on your graph. What is the least square error? (
c) Find a parabola that best fits the data (for help, see textbook p. 225). Which curve best fits the
data?
• You may use the following built-in linear solvers: Python: numpy.linalg.solve, Matlab: linsolve.
• In addition to your code, you must show the derivation of the equations you are solving.
A sensor records measurements ui at different instants ti . The data is stored as pairs of (t, u) in the
file data.dat . Read in the data and perform the following:
(a) Using Python or Matlab, plot the measurements at their corresponding time on a graph.
(b) Find the line that best fits the data and plot it on your graph. What is the least square error? (
c) Find a parabola that best fits the data (for help, see textbook p. 225). Which curve best fits the
data?