|
Posted: 09/13/23
Due: 09/20/23, 11:59PM
Tracks 1 & 2: 1. Track 2: 2.
This homework marks your first foray into realistic scientific computation by applying concepts from linear algebra, specifically using the singular value decomposition to analyze hurricane Lee, still active at this time.
Processing of image data through the tools of linear algebra is often encountered, and in this assignment you shall work with satellite images of hurricane Lee of 2023 Season. Open the following folds and execute the code to set up your environment.
The following commands within a BASH shell brings up an animation of hurricane Lee (ImageMagick package must be installed and in the system path.
The model will use various Julia packages to process image data, carry out linear algebra operations. The following commands build the appropriate Julia environment. The Julia packages are downloaded, compiled and stored in your local Julia library. Note: compiling the Images package takes a long time and it's best to do this within a terminal window. Compiling the packages need only be done once.
Once compiled, packages are imported into the current environment
With appropriate packages in place and available, the satellite imagery can be imported into the Julia environment and used to insert images such as the one in Fig. (1).
Image data must be quantified, i.e., transformed into numbers prior to analysis. In this case matrices of 32-bit floats are obtained from the gray-scale intensity values associated with each pixel. The 720 by 850 pixel images might be too large for machines with limited hardware resources, so adapt the window to obtain reasonable code execution times, Fig. 2.
![]() |
The SVD of the array of floats obtained from an image identifies correlations in gray-level intensity between pixel positions, an encoded description of weather physics. Here are the Julia instructions to compute the SVD of one frame of image data. It is instructive to plot the singular values , in log coordinates.
∴ |
n=32; A=data[:,:,n]; U,S,V=svd(A); |
∴ |
clf(); plot(log.(S),"o"); xlabel(L"mode number $k$"); ylabel(L"lg(\sigma_k)"); |
∴ |
title("Singular values of hurricane Lee image"); grid("on"); |
∴ |
savefig(hwdir*"/H03Fig03a.eps"); |
∴ |
clf(); plot(log.(S[1:100]),"o"); xlabel(L"mode number $k$"); ylabel(L"lg(\sigma_k)"); |
∴ |
title("Singular values of hurricane Lee image"); grid("on"); |
∴ |
savefig(hwdir*"/H03Fig03b.eps"); |
∴ |
![]() ![]() |
Define a function rsvd to sum the rank-one updates from to from an SVD,
The sum from to contains the first dominant correlations, identified as large scale weather patterns. The sum from to can be identified as small scale patterns.
![]() ![]() |
Consider large-scale weather patterns , , obtained from the most significant modes from frames (i.e., different times in the past). Assuming a constant rate of change leads to the prediction
(3) |
for the known large-scale weather . The prediction error is . Present a plot of the prediction error for various values of over the recorded hurricane data. Analyze your results to answer the question: “can overall storm evolution be predicted by linear extrapolation of past data?”
Solution.
Repeat the above construction of an error plot for local weather patterns for lesser significance modes from to , that lead to prediction
Analyze your results to answer the question: “are small-scale storm features predictable?”
Solution.
Repeat the above for combined large () and small scale () weather patterns. Experiment with different weights in the linear combination , .
Solution.
Formula (3) expresses a degree-one in time prediction
evaluated at . Construct a quadratic prediction based upon data , and compare with degree-one prediction in question 1. Recall that a quadratic can be constructed from knowledge of three points. Again, experiment with various values of .
Solution.
Use the SVD to investigate how familiar properties for might extend to matrices . For example, on the real axis adding to results in the null element, , so we say is a distance from zero. This easily generalizes to , and the minimal modification of to obtain zero is , , and is distance away from zero. Consider now matrices , with . How far is this matrix from “zero”? By “zero” we shall understand a singular matrix with .
All real numbers can be obtained as the limit of a sequence of rationals , . We say that the rationals is a dense subset of . What about matrix spaces?
Find of minimal norm such that is singular. State how far is from “zero”?
Prove that any matrix in is the limit of a sequence of matrices of full rank, i.e., the set of full-rank matrices is a dense subset of .