You will download this data file from the adams server, and store it on your Python directory. Note that you will need to be on campus or use the VPN for that link to work. The data are from the DART project, and represent passage of various species of anadromous fish past the Lower Granite Dam, from 1975 to the present. You will read the data into a Python notebook that you make. Note that the first row of the file is text describing the contents of each column of the data.
Once you have the data in your script, use the normal equations as discussed in class, and shown in a notebook on adams, to plot the data for fish passage against the year, and to find a linear model for those numbers. Your script should make a plot similar to Figure 1. Set the script up so that you can specify the index of the column of data you want to fit, e.g. chinook from the second column, steelhead from the fourth column, or lamprey from some other column. In other words, you set that index in one place, and the column, title, and axis label change accordingly.
You may not use Scikit Learn or any other statistics package to solve the normal equations. Also you may not compute an inverse matrix (we never compute inverse matrices).
Figure 1: Chinook Salmon Passage
The assignment is turned in as an .ipynb attachment to an email sent to the instructor by 9AM on Friday, 1 December. It is worth 40 points.
Note that some people are reporting that their browser refuses to download the data file. This seems to be because adams uses HTTP, not HTTPS. There is no need for an encrypted connection for this public data file, but some browsers require it nonetheless by default. You have various choices.
- If the browser tells you the connection is insecure, just click the button that says do it anyway.
- You can use Filezilla to go to adams, surf up to the /pub directory, down to kcooper, and then download the file directly.
- You can configure your browser to allow you to download files over unencrypted connections. In Firefox, for example, Navigate to about:config within Firefox; Search for dom.block_download_insecure;. Set dom.block_download_insecure to False.