# ICE 7

As usual, we recognize that this is a stupid way to approach a problem mathematically - it is just a fun way to make a point, and to use the linalg subpackage of scipy.

Use the data from KlamathKenoMonthly.py (probably already on your computer) to write a Python script to do the following.

- It should average the flows in the last column
of the
`data`array by month, over all the years of the measurements. Store the result in an array of length 12. We denote that resulting vector \(y\). - Choose a degree for a least-squares fit to the data.
- Form a matrix whose columns are the values of monic polynomials at the months of the study. I.e. if the degree of the polynomial fit is to be 2, then the matrix is: \[ A = \begin{bmatrix} 1 & 1 & 1\\ 1 & 2 & 2^2\\ 1 & 3 & 3^2\\ \vdots & \vdots & \vdots\\ 1 & 12 & 12^2 \end{bmatrix} \]
- Solve the normal equations \(A^TAc=A^Ty\). The array \(c\) contains the coefficients of the polynomial fit.
- Plot the months against the data \(y\) and the polynomial that resulted from solving the normal equations.

Assignment 3 is posted.