Tutorials › Linear Algebra › Full, Thin, And Compact SVD Shapes

Singular Value Decomposition · Tutorial 783 of 1000

Full, Thin, And Compact SVD Shapes

Learn how the dimensions and retained singular-vector columns distinguish full, thin, and compact SVDs.

Advanced 9 min read

What You'll Learn

  • Identify the dimensions of the three SVD conventions for an m-by-n matrix.
  • Distinguish the number of singular values retained in a thin SVD from those in a compact SVD.
  • Convert a full SVD into thin and compact forms by selecting columns and diagonal entries.
  • Relate the number of positive singular values to the rank of a matrix.
  • Check that each SVD factorization is dimensionally valid and reconstructs the original matrix.

Why One SVD Has Several Shapes

The singular value decomposition of a matrix can be written with different numbers of columns in its orthogonal factors. These forms encode the same matrix, but they do not retain the same information about directions associated with zero singular values. To choose or interpret an SVD correctly, track three quantities: the row count \(m\), the column count \(n\), and the rank \(r\).

Throughout, let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), with \(m,n\geq 1\), and put \(k=\min(m,n)\). An orthogonal matrix is a square real matrix \(\mathbf{Q}\) satisfying \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}\). We use the real singular value decomposition established earlier in the course: there are orthogonal matrices \(\mathbf{U}\in\mathbb{R}^{m\times m}\) and \(\mathbf{V}\in\mathbb{R}^{n\times n}\) such that \(\mathbf{A}=\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}\). The diagonal entries of the rectangular matrix \(\boldsymbol{\Sigma}\in\mathbb{R}^{m\times n}\) are the singular values \(\sigma_1\geq\cdots\geq\sigma_k\geq0\), with other entries zero.

Let \(r=\operatorname{rank}\mathbf{A}\), where rank is the dimension of the column space. The shape conventions below specify precisely how many columns of the orthogonal factors are kept. Terminology can vary across texts, so the dimensions—not just the word “thin”—are the reliable guide.

The Three Shape Conventions

Definition: For \(\mathbf{A}\in\mathbb{R}^{m\times n}\), set \(k=\min(m,n)\) and let \(r=\operatorname{rank}\mathbf{A}\). In the full SVD, \(\mathbf{U}\) is \(m\times m\), \(\boldsymbol{\Sigma}\) is \(m\times n\), and \(\mathbf{V}\) is \(n\times n\). In the thin SVD used here, \(\mathbf{U}_k\) is \(m\times k\), \(\mathbf{D}_k\) is \(k\times k\), and \(\mathbf{V}_k\) is \(n\times k\). In the compact SVD, \(\mathbf{U}_r\) is \(m\times r\), \(\mathbf{D}_r\) is \(r\times r\), and \(\mathbf{V}_r\) is \(n\times r\). Each factorization has the form \(\mathbf{A}=\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}\), with the matching factors for that convention.

For the full SVD, \(\boldsymbol{\Sigma}\) is rectangular and has \(\sigma_i\) in position \((i,i)\), for \(1\leq i\leq k\). In the thin and compact forms, the middle factor is square and diagonal: \(\mathbf{D}_k=\operatorname{diag}(\sigma_1,\ldots,\sigma_k)\) and \(\mathbf{D}_r=\operatorname{diag}(\sigma_1,\ldots,\sigma_r)\). The columns of \(\mathbf{U}_k,\mathbf{V}_k\) are the first \(k\) columns of the full factors; those of \(\mathbf{U}_r,\mathbf{V}_r\) are the first \(r\).

ConventionLeft factorMiddle factorRight factorSingular values retained
Full\(m\times m\)\(m\times n\)\(n\times n\)All \(k\), including zeros
Thin\(m\times k\)\(k\times k\)\(n\times k\)All \(k\), including zeros
Compact\(m\times r\)\(r\times r\)\(n\times r\)Only the \(r\) positive values

The dimensions make each product valid: for example, \((m\times k)(k\times k)(k\times n)\) gives an \(m\times n\) matrix. If \(r<k\), the compact form is smaller than the thin form because it omits the zero singular-value directions. If \(r=k\), thin and compact have identical dimensions. If \(r=0\), the compact factors have zero columns and \(\mathbf{D}_r\) is \(0\times0\); their product is the \(m\times n\) zero matrix.

Why Truncating the Full SVD Works

Theorem (Shape and rank of the SVD): Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\) have a full real SVD, and let \(k=\min(m,n)\). The number of positive singular values is \(\operatorname{rank}\mathbf{A}\). Keeping the first \(k\) columns of the full orthogonal factors gives a thin SVD; keeping only the columns belonging to positive singular values gives a compact SVD. Both products equal \(\mathbf{A}\).

Proof. Write the columns of the full factors as \(\mathbf{u}_1,\ldots,\mathbf{u}_m\) and \(\mathbf{v}_1,\ldots,\mathbf{v}_n\). From the diagonal structure of \(\boldsymbol{\Sigma}\), multiplication gives \(\mathbf{A}=\sum_{i=1}^{k}\sigma_i\mathbf{u}_i\mathbf{v}_i^{\top}\). Let \(s\) be the number of positive singular values. Since the values are ordered, \(\sigma_i>0\) for \(1\leq i\leq s\), and \(\sigma_i=0\) for \(s<i\leq k\). For any \(\mathbf{x}\in\mathbb{R}^n\), this sum shows that \(\mathbf{A}\mathbf{x}=\sum_{i=1}^{s}\sigma_i(\mathbf{v}_i^{\top}\mathbf{x})\mathbf{u}_i\), so the column space is contained in \(\operatorname{span}\{\mathbf{u}_1,\ldots,\mathbf{u}_s\}\). Also \(\mathbf{A}\mathbf{v}_j=\sigma_j\mathbf{u}_j\) for \(1\leq j\leq s\), because the \(\mathbf{v}_i\) are orthonormal. Dividing by the nonzero \(\sigma_j\) puts each \(\mathbf{u}_j\) in the column space. Thus the column space equals that span. Its \(s\) vectors are orthonormal, hence linearly independent, so the rank is \(s\). The displayed sum is unchanged if it is written using the first \(k\) terms, including zero terms, or only the first \(s=r\) terms. Those two groupings are exactly the thin and compact products, respectively. \(\square\)

This argument also explains the roles of the columns. The thin SVD retains a complete list of \(k\) singular-vector pairs, even when some pairs are multiplied by zero. The compact SVD retains only pairs that contribute nonzero terms to the reconstruction. A zero singular value does not contribute to \(\mathbf{A}\), but its corresponding vectors can still be part of the full orthogonal bases.

Worked Shapes for a Wide Rank-Deficient Matrix

Worked Example: Full, Thin, and Compact Forms for a Wide Matrix

Consider the \(2\times3\) matrix \(\mathbf{A}=\begin{bmatrix}0&3&0\\0&0&0\end{bmatrix}\). Its rank is \(r=1\), and \(k=\min(2,3)=2\). The nonzero singular value is \(3\). Choose the full factors

$$ \mathbf{U}=\begin{bmatrix}1&0\\0&1\end{bmatrix},\qquad \boldsymbol{\Sigma}=\begin{bmatrix}3&0&0\\0&0&0\end{bmatrix},\qquad \mathbf{V}=\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}. $$

Here \(\mathbf{U}\) and \(\mathbf{V}\) are orthogonal: \(\mathbf{U}^{\top}\mathbf{U}=\mathbf{I}_2\) and \(\mathbf{V}^{\top}\mathbf{V}=\mathbf{I}_3\). The full product is

$$ \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top} = \begin{bmatrix}3&0&0\\0&0&0\end{bmatrix} \begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix} = \begin{bmatrix}0&3&0\\0&0&0\end{bmatrix} =\mathbf{A}. $$

For the thin form, retain the first \(k=2\) columns of \(\mathbf{V}\), giving \(\mathbf{V}_k=\begin{bmatrix}0&1\\1&0\\0&0\end{bmatrix}\), and use \(\mathbf{U}_k=\mathbf{I}_2\) and \(\mathbf{D}_k=\begin{bmatrix}3&0\\0&0\end{bmatrix}\). The dimensions are \(2\times2\), \(2\times2\), and \(3\times2\). Checking the product, \(\mathbf{D}_k\mathbf{V}_k^{\top}=\begin{bmatrix}0&3&0\\0&0&0\end{bmatrix}\), so \(\mathbf{U}_k\mathbf{D}_k\mathbf{V}_k^{\top}=\mathbf{A}\).

For the compact form, keep only the first singular-vector pair: \(\mathbf{U}_r=\begin{bmatrix}1\\0\end{bmatrix}\), \(\mathbf{D}_r=\begin{bmatrix}3\end{bmatrix}\), and \(\mathbf{V}_r=\begin{bmatrix}0\\1\\0\end{bmatrix}\). Then

$$ \mathbf{U}_r\mathbf{D}_r\mathbf{V}_r^{\top} = \begin{bmatrix}1\\0\end{bmatrix} \begin{bmatrix}3\end{bmatrix} \begin{bmatrix}0&1&0\end{bmatrix} = \begin{bmatrix}0&3&0\\0&0&0\end{bmatrix}. $$

The zero second singular value explains why the thin form has one more column in each singular-vector factor than the compact form.

When Thin and Compact Have the Same Size

Worked Example: A Tall Matrix of Full Column Rank

Let \(\mathbf{A}=\begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix}\). Its columns are independent, so \(r=2\), and \(k=\min(3,2)=2\). An SVD is given by \(\mathbf{U}=\mathbf{I}_3\), \(\boldsymbol{\Sigma}=\begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix}\), and \(\mathbf{V}=\mathbf{I}_2\). The full product checks directly:

$$ \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top} = \begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix} =\mathbf{A}. $$

The thin factors are \(\mathbf{U}_k=\begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix}\), \(\mathbf{D}_k=\begin{bmatrix}2&0\\0&1\end{bmatrix}\), and \(\mathbf{V}_k=\mathbf{I}_2\). Multiplication gives \(\mathbf{U}_k\mathbf{D}_k\mathbf{V}_k^{\top}=\begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix}\). Because \(r=k=2\), the compact factors are exactly these same three matrices. The full left factor has three columns, whereas both reduced forms need only two.

A Rank-Deficient Tall Example

Worked Example: Removing a Zero Singular-Value Direction

Take \(\mathbf{A}=\begin{bmatrix}0&0\\5&0\\0&0\end{bmatrix}\), so \(m=3\), \(n=2\), \(k=2\), and \(r=1\). Let the columns of the full \(\mathbf{U}\) be \(\mathbf{e}_2,\mathbf{e}_1,\mathbf{e}_3\), in that order, and let \(\mathbf{V}=\mathbf{I}_2\). Explicitly, set \(\mathbf{U}=\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}\), with \(\boldsymbol{\Sigma}=\begin{bmatrix}5&0\\0&0\\0&0\end{bmatrix}\). Both full orthogonal factors have orthonormal columns. The product is

$$ \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top} = \begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix} \begin{bmatrix}5&0\\0&0\\0&0\end{bmatrix} \begin{bmatrix}1&0\\0&1\end{bmatrix} = \begin{bmatrix}0&0\\5&0\\0&0\end{bmatrix} =\mathbf{A}. $$

The thin form uses \(\mathbf{U}_k=\begin{bmatrix}0&1\\1&0\\0&0\end{bmatrix}\), \(\mathbf{D}_k=\begin{bmatrix}5&0\\0&0\end{bmatrix}\), and \(\mathbf{V}_k=\mathbf{I}_2\). Multiplying gives \(\mathbf{U}_k\mathbf{D}_k\mathbf{V}_k^{\top}=\begin{bmatrix}0&0\\5&0\\0&0\end{bmatrix}\). The compact form keeps only \(\mathbf{u}_1=\begin{bmatrix}0\\1\\0\end{bmatrix}\) and \(\mathbf{v}_1=\begin{bmatrix}1\\0\end{bmatrix}\), with \(\mathbf{D}_r=\begin{bmatrix}5\end{bmatrix}\). Thus \(\mathbf{U}_r\mathbf{D}_r\mathbf{V}_r^{\top}=\begin{bmatrix}0\\5\\0\end{bmatrix}\begin{bmatrix}1&0\end{bmatrix}=\mathbf{A}\). The thin form has two singular-vector columns on each side; the compact form has one.

Common Mistake: Moving a Singular Value Off the Diagonal

A singular-value matrix is diagonal-shaped: its only possibly nonzero entries are in positions \((i,i)\). It is not enough for a proposed middle matrix to multiply with two orthogonal matrices and reconstruct \(\mathbf{A}\); its entries must also be the ordered singular values in diagonal positions.

For the first example, a tempting but incorrect choice is \(\mathbf{U}=\mathbf{I}_2\), \(\mathbf{V}=\mathbf{I}_3\), and \(\boldsymbol{\Sigma}=\begin{bmatrix}0&3&0\\0&0&0\end{bmatrix}\). The product does equal \(\mathbf{A}\), but the diagonal entries are \(0,0\), while the \(3\) is off the diagonal. Therefore this is not an SVD. The corrected full factors are \(\mathbf{U}=\mathbf{I}_2\), \(\mathbf{V}=\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}\), and \(\boldsymbol{\Sigma}=\begin{bmatrix}3&0&0\\0&0&0\end{bmatrix}\). The value \(3\) is now on the diagonal, and the reordered right singular vectors make the product reconstruct \(\mathbf{A}\).

Another useful check is to write the dimensions beside every factor before multiplying. A rectangular full \(\boldsymbol{\Sigma}\) is \(m\times n\); the middle matrix in the thin or compact convention is square. These choices are not interchangeable without also changing the dimensions and columns of the other factors.

Choosing a Form

The full SVD is useful when a complete orthogonal basis on both sides is needed. The thin SVD removes columns that are unnecessary solely because one dimension of the matrix is larger, but it still keeps zero singular-value directions among the first \(k\). The compact SVD is the smallest of the three: it retains exactly the directions that contribute to the matrix.

Before using a displayed factorization, check that the singular values are ordered, that the middle factor has the required diagonal shape, and that adjacent dimensions match. Then multiply the factors, or use the rank-one expansion \(\mathbf{A}=\sum_{i=1}^{r}\sigma_i\mathbf{u}_i\mathbf{v}_i^{\top}\) to check which terms actually contribute. This distinguishes a valid SVD from a product that happens to equal the matrix but has incorrectly arranged factors.

Check Your Understanding

For each question, state dimensions explicitly and use the definitions above.

  1. If \(\mathbf{A}\in\mathbb{R}^{5\times3}\) has rank \(2\), give the dimensions of all three factors in its full, thin, and compact SVDs.
  2. For a \(4\times7\) matrix of rank \(4\), do the thin and compact SVDs have the same dimensions? Explain using \(k\) and \(r\).
  3. How many singular values are retained in the thin SVD of a rank-one \(3\times2\) matrix, and how many in its compact SVD?
  4. Why can a zero singular value be present in a thin SVD but absent from a compact SVD?
  5. For \(\mathbf{A}=\begin{bmatrix}2&0\\0&0\\0&0\end{bmatrix}\), write the compact factors using standard basis vectors and verify their product.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon