As usual, we regret that this is a made-up example, but it is just a way to make a point, and to use the linalg subpackage of scipy. Incidentally, I tried to use the Klamath Flow data to make a real problem involving averaging, but it did not really illustrate the ideas adequately, and would have involved too many technical issues for an ICE.
Use the Scipy function linalg.hilbert() to make a Hilbert matrix \(A\) of dimension 100. Make a solution vector \(x\) composed of 100 ones, and find a right-hand-side vector \(y\) as \(y=Ax.\)
- Now solve for \(x\) using the linalg.solve() function. Compare with the actual solution \(x\).
- Use Tikhonov regularization to solve for \(x\). Compare.
- Use a Truncated SVD to solve for \(x\). Compare.
- If time permits, do all this also for a uniformly distributed random vector for \(x\), and/or for a sinusoidal vector with 3-5 oscillations.
Assignment 3 is posted.