Homework #3: Least squares (hipsters only)

Posted 3/17; Due 3/31

Background

From the Ooky-gooky-pedia article on least squares:

"The method of least squares, also known as regression analysis, is used to model numerical data obtained from observations by adjusting the parameters of a model so as to get an optimal fit of the data. The best fit is characterized by the sum of squared residuals having its least value, a residual being the difference between an observed value and the value given by the model. The method was first described by Carl Friedrich Gauss around 1794. Least squares corresponds to the maximum likelihood criterion if the experimental errors have a normal distribution. Regression analysis is available in most statistical software packages."

See also chapter 8 in the Burden and Faires textbook.

For information on the carbon dioxide concentration as measured on the peak at Mauna Loa, see this file.

Questions

The basics

Things I'd like to see you do if you have time (Part I: Simple data, "bad" data)

Things I'd like to see you do if you have time (Part II: More complicated models and some numerical problems)

Notes

As before, the first thing I'm gonna do is test your code. If it doesn't work, you better already know that and have told me in advance. In that case, you should at least:

Note that the last two are often different things.

Also: