Exercises

SVD of simple matrices

  1. Consider the matrix
A=\left(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{array}\right).
    1. Find the range, nullspace, and rank of A.
    2. Find an SVD of A.
    3. Determine the set of solutions to the linear equation Ax=y, with
y=\left(\begin{array}{l} 2 \\ 3 \\ 0 \\ 0 \end{array}\right), y=\left(\begin{array}{l} 2 \\ 0 \\ 0 \\ 3 \end{array}\right).
  1. Consider the 2 \times 2 matrix
A=\frac{1}{\sqrt{10}}\left(\begin{array}{l} 2 \\ 1 \end{array}\right)\left(\begin{array}{ll} 1 & -1 \end{array}\right)+\frac{2}{\sqrt{10}}\left(\begin{array}{c} -1 \\ 2 \end{array}\right)\left(\begin{array}{ll} 1 & 1 \end{array}\right).
    1. What is an SVD of A? Express it as A = USV^T, with S the diagonal matrix of singular values ordered in decreasing fashion. Make sure to check all the properties required for U,S,V.
    2. Find the semi-axis lengths and principal axes (minimum and maximum distance and associated directions from {\bf E} to the center) of the ellipsoid
{\bf E}(A) = \{Ax: x \in \mathbb{R}^2, ||x||_2 \leq 1\}.

Hint: Use the SVD of A to show that every element of \mathcal{E}(A) is of the form y = U \overline{y} for some element \overline{y} in \mathcal{E}(S). That is, \mathcal{E}(A) = \{U\overline{y}: \overline{y} \in \mathcal{E}(S)\}. (In other words, the matrix U maps \mathcal{E}(S) into the set \mathcal{E}(A).) Then analyze the geometry of the simpler set \mathcal{E}(S).

    1. What is the set \mathcal{E}(A) when we append a zero vector after the last column of A, that is A is replaced with \tilde{A} = (A, 0) \in \mathbb{R}^{2 \times 3}?
    2. The same question when we append a row after the last row of A, that is, A is replaced with \tilde{A} = [A^T, 0]^T \in \mathbb{R}^{3 \times 2}. Interpret geometrically your result.

Rank and SVD

alt text The image on the left shows a 256 \times 256 matrix A of pixel values. The lines indicate +1 values; at each intersection of lines, the corresponding matrix element is +2. All the other elements are zero.

  1. Show that for some permutation matrices P, Q, the permuted matrix B: = PAQ has the symmetric form B = pq^T + qp^T, for two vectors p, q. Determine P, Q, B and p, q.
  2. What is the rank of AHint: find the nullspace of B.
  3. Find an SVD of AHint: Find an eigenvalue decomposition of S, using the results of an exercise on eigenvalue here.

Procrustes problem

The Orthogonal Procrustes problem is a problem of the form

\min\limits_{X} ||AX=B||_F: X^TX = I_p,

where ||\cdot||_F denotes the Frobenius norm, and the matrices A \in \mathbb{R}^{m \times n}, B \in \mathbb{R}^{m \times p} are given. Here, the matrix variable X \in \mathbb{R}^{n \times p} is constrained to have orthonormal columns. When n=m=p, the problem can be interpreted geometrically as seeking a transformation of points (contained in A) to other points (contained in B) that involves only rotation.

  1. Show that the solution to the Procrustes problem above can be found via the SVD of the matrix A^TB.
  2. Derive a formula for the answer to the constrained least-squares problem
\min\limits_{x} ||Ax-b||_2: ||x||_2=1,

with A \in \mathbb{R}^{m \times n}, b \in \mathbb{R}^m given.

SVD and projections

  1. We consider a set of m data points x_i \in \mathbb{R}^n, i = 1, cdots, m. We seek to find a line in \mathbb{R}^n such that the sum of the squares of the distances from the points to the line is minimized. To simplify, we assume that the line goes through the origin.
    1. Consider a line that goes through the origin \mathcal{L} = \{tu: t\in\mathbb{R}\}, where u \in \mathbb{R}^n is given. (You can assume without loss of generality that ||u||_2=1.) Find an expression for the projection of a given point x on \mathcal{L}.
    2. Now consider the m points and find an expression for the sum of the squares of the distances from the points to the line \mathcal{L}.
    3. Explain how you would find the line via the SVD of the n\times m matrix X = [x_1, \cdots, x_m].
    4. How would you address the problem without the restriction that the line has to pass through the origin?
  2. Solve the same problems as previously by replacing the line with a hyperplane.

SVD and least-squares

  1. Consider the matrix A formed as A = (c_1, c_2, c_3), with
c_1 = (1, 2, 8),\quad c_2 = (3, 6, 9),\quad c_3 = c_1 - 4c_2 + \epsilon_1 v, \quad \epsilon_1 = .0000001,

with v a vector chosen randomly in [-1/2, 1/2]^4. In addition, we define

y = 2c_1 - 7c_2 + \epsilon_2 w, \quad \epsilon_2 = .0001,

with again w chosen randomly in [-1/2, 1/2]^4. We consider the associated least-squares problem

\min\limits_x ||Ax-y||_2.
    1. What is the rank of A?
    2. Apply the least-squares formula x^* = (A^TA)^{-1}A^Ty. What is the norm of the residual vector, r = Ax-y?
    3. Express the least-squares solution in terms of the SVD of A. That is, form the pseudo-inverse of A and apply the formula x^* = A^{\dagger} y. What is now the norm of the residual?
    4. Interpret your results.
  1. Consider a least-squares problem
\min\limits_x ||Ax-y||_2

where the data matrix A \in \mathbb{R}^{m \times n} has rank one.

    1. Is the solution unique?
    2. Show how to reduce the problem to one involving one scalar variable.
    3. Express the set of solutions in closed form.

License

Hyper-Textbook: Optimization Models and Applications Copyright © by L. El Ghaoui. All Rights Reserved.

Share This Book