Session Ready
Exercise

Minimizing the Residuals

In this exercise, you will complete a function to visually compare model and data, and compute and print the RSS. You will call it more than once to see how RSS changes when you change values for a0 and a1. We'll see that the values for the parameters we found earlier are the ones needed to minimize the RSS.

Instructions
100 XP
  • Fill in the call to model() passing in the data xd and model parameters a0 and a1.
  • Compute rss as the sum of the square of the residuals.
  • Use compute_rss_and_plot_fit() for various values of a0 and a1 to see how they change RSS.
  • Convince yourself that the original values a0=150 and a1=25 minimize RSS, and submit your answer with these.