Singular value decomposition: Difference between revisions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
imported>Kvng
m add link
imported>Oshwah
m Reverted edits by ~2025-32462-61 (talk): editing tests (HG) (3.4.13)
 
Line 16: Line 16:


The diagonal entries <math>\sigma_i = \Sigma_{i i}</math> of <math>\mathbf \Sigma</math> are uniquely determined by {{tmath|\mathbf M}} and are known as the [[singular value]]s of {{tmath|\mathbf M}}. The number of non-zero singular values is equal to the [[rank of a matrix|rank]] of {{tmath|\mathbf M}}. The columns of {{tmath|\mathbf U}} and the columns of {{tmath|\mathbf V}} are called left-singular vectors and right-singular vectors of {{tmath|\mathbf M}}, respectively. They form two sets of [[orthonormal basis|orthonormal bases]] {{tmath|\mathbf u_1, \ldots, \mathbf u_m}} and {{tmath|\mathbf v_1, \ldots, \mathbf v_n,}} and if they are sorted so that the singular values <math>\sigma_i</math> with value zero are all in the highest-numbered columns (or rows), the singular value decomposition can be written as
The diagonal entries <math>\sigma_i = \Sigma_{i i}</math> of <math>\mathbf \Sigma</math> are uniquely determined by {{tmath|\mathbf M}} and are known as the [[singular value]]s of {{tmath|\mathbf M}}. The number of non-zero singular values is equal to the [[rank of a matrix|rank]] of {{tmath|\mathbf M}}. The columns of {{tmath|\mathbf U}} and the columns of {{tmath|\mathbf V}} are called left-singular vectors and right-singular vectors of {{tmath|\mathbf M}}, respectively. They form two sets of [[orthonormal basis|orthonormal bases]] {{tmath|\mathbf u_1, \ldots, \mathbf u_m}} and {{tmath|\mathbf v_1, \ldots, \mathbf v_n,}} and if they are sorted so that the singular values <math>\sigma_i</math> with value zero are all in the highest-numbered columns (or rows), the singular value decomposition can be written as
<math display=block>
<math display=block>
\mathbf{M} = \sum_{i=1}^{r}\sigma_i\mathbf{u}_i\mathbf{v}_i^{*},
\mathbf{M} = \sum_{i=1}^{r}\sigma_i\mathbf{u}_i\mathbf{v}_i^{*},
</math>
</math>
where <math>r \leq \min\{m,n\}</math> is the rank of {{tmath|\mathbf M.}}
where <math>r \leq \min\{m,n\}</math> is the rank of {{tmath|\mathbf M.}}


Line 34: Line 32:


=== Rotation, coordinate scaling, and reflection ===
=== Rotation, coordinate scaling, and reflection ===
In the special case when {{tmath|\mathbf M}} is an {{tmath|m \times m}} real [[square matrix]], the matrices {{tmath|\mathbf U}} and {{tmath|\mathbf V^*}} can be chosen to be real {{tmath|m \times m}} matrices too.  In that case, "unitary" is the same as "[[orthogonal matrix|orthogonal]]".  Then, interpreting both unitary matrices as well as the diagonal matrix, summarized here as {{tmath|\mathbf A,}} as a [[linear transformation]] {{tmath| \mathbf x \mapsto \mathbf{Ax} }} of the space {{tmath|\mathbf R_m,}} the matrices {{tmath|\mathbf U}} and {{tmath|\mathbf V^*}} represent [[rotation (geometry)|rotations]] or [[reflection (geometry)|reflection]] of the space, while {{tmath|\mathbf \Sigma}} represents the [[scaling matrix|scaling]] of each coordinate {{tmath|\mathbf x_i}} by the factor {{tmath|\sigma_i.}}  Thus the SVD decomposition breaks down any linear transformation of {{tmath|\mathbf R^m}} into a [[function composition|composition]] of three geometrical [[transformation (geometry)|transformations]]: a rotation or reflection {{nobr|({{tmath|\mathbf V^*}}),}} followed by a coordinate-by-coordinate [[scaling (geometry)|scaling]] {{nobr|({{tmath|\mathbf \Sigma}}),}} followed by another rotation or reflection {{nobr|({{tmath|\mathbf U}}).}}
In the special case when {{tmath|\mathbf M}} is an {{tmath|m \times m}} real [[square matrix]], the matrices {{tmath|\mathbf U}} and {{tmath|\mathbf V^*}} can be chosen to be real {{tmath|m \times m}} matrices too.  In that case, "unitary" is the same as "[[orthogonal matrix|orthogonal]]".  Then, interpreting both unitary matrices as well as the diagonal matrix, summarized here as {{tmath|\mathbf A,}} as a [[linear transformation]] {{tmath| \mathbf x \mapsto \mathbf{Ax} }} of the space {{tmath|\mathbf R^m,}} the matrices {{tmath|\mathbf U}} and {{tmath|\mathbf V^*}} represent [[rotation (geometry)|rotations]] or [[reflection (geometry)|reflection]] of the space, while {{tmath|\mathbf \Sigma}} represents the [[scaling matrix|scaling]] of each coordinate {{tmath|\mathbf x_i}} by the factor {{tmath|\sigma_i.}}  Thus the SVD decomposition breaks down any linear transformation of {{tmath|\mathbf R^m}} into a [[function composition|composition]] of three geometrical [[transformation (geometry)|transformations]]: a rotation or reflection {{nobr|({{tmath|\mathbf V^*}}),}} followed by a coordinate-by-coordinate [[scaling (geometry)|scaling]] {{nobr|({{tmath|\mathbf \Sigma}}),}} followed by another rotation or reflection {{nobr|({{tmath|\mathbf U}}).}}


In particular, if {{tmath|\mathbf M}} has a positive determinant, then {{tmath|\mathbf U}} and {{tmath|\mathbf V^*}} can be chosen to be both rotations with reflections, or both rotations without reflections.{{Citation needed|date=September 2022}} If the determinant is negative, exactly one of them will have a reflection. If the determinant is zero, each can be independently chosen to be of either type.
In particular, if {{tmath|\mathbf M}} has a positive determinant, then {{tmath|\mathbf U}} and {{tmath|\mathbf V^*}} can be chosen to be both rotations with reflections, or both rotations without reflections.{{Citation needed|date=September 2022}} If the determinant is negative, exactly one of them will have a reflection. If the determinant is zero, each can be independently chosen to be of either type.
Line 56: Line 54:


The [[linear transformation]]
The [[linear transformation]]
<math display=block>
<math display=block>
T : \left\{\begin{aligned}
T : \left\{\begin{aligned}
Line 62: Line 59:
   x &\mapsto \mathbf{M}x \end{aligned}\right.
   x &\mapsto \mathbf{M}x \end{aligned}\right.
</math>
</math>
has a particularly simple description with respect to these orthonormal bases: we have
has a particularly simple description with respect to these orthonormal bases: we have
<math display=block>
<math display=block>
T(\mathbf{V}_i) = \sigma_i \mathbf{U}_i, \qquad i
T(\mathbf{V}_i) = \sigma_i \mathbf{U}_i, \qquad i
= 1, \ldots, \min(m, n),
= 1, \ldots, \min(m, n),
</math>
</math>
where {{tmath|\sigma_i}} is the {{tmath|i}}-th diagonal entry of {{tmath|\mathbf \Sigma,}} and {{tmath|T(\mathbf V_i) {{=}} 0}} for {{tmath|i > \min(m,n).}}
where {{tmath|\sigma_i}} is the {{tmath|i}}-th diagonal entry of {{tmath|\mathbf \Sigma,}} and {{tmath|T(\mathbf V_i) {{=}} 0}} for {{tmath|i > \min(m,n).}}


Line 78: Line 72:
== Example ==
== Example ==
Consider the {{tmath|4 \times 5}} matrix
Consider the {{tmath|4 \times 5}} matrix
<math display=block>
<math display=block>
\mathbf{M} = \begin{bmatrix}
\mathbf{M} = \begin{bmatrix}
Line 135: Line 128:


This particular singular value decomposition is not unique.  For instance, we can keep {{tmath|\mathbf U}} and {{tmath|\mathbf \Sigma}} the same, but change the last two rows of {{tmath|\mathbf V^*}} such that
This particular singular value decomposition is not unique.  For instance, we can keep {{tmath|\mathbf U}} and {{tmath|\mathbf \Sigma}} the same, but change the last two rows of {{tmath|\mathbf V^*}} such that
<math display=block>\mathbf{V}^* = \begin{bmatrix}
<math display=block>\mathbf{V}^* = \begin{bmatrix}
   \color{Violet}0        & \color{Violet}0    & \color{Violet}-1  & \color{Violet}0  &\color{Violet}0 \\
   \color{Violet}0        & \color{Violet}0    & \color{Violet}-1  & \color{Violet}0  &\color{Violet}0 \\
Line 147: Line 139:


The [[#Compact SVD|compact SVD]], {{tmath|1= \mathbf M = \mathbf{U}_r\mathbf{\Sigma}_r \mathbf{V}_r^* }}, eliminates these superfluous rows, columns, and singular values:
The [[#Compact SVD|compact SVD]], {{tmath|1= \mathbf M = \mathbf{U}_r\mathbf{\Sigma}_r \mathbf{V}_r^* }}, eliminates these superfluous rows, columns, and singular values:
<math display=block>\begin{align}
<math display=block>\begin{align}
\mathbf{U}_r &= \begin{bmatrix}
\mathbf{U}_r &= \begin{bmatrix}
Line 171: Line 162:
== SVD and spectral decomposition ==
== SVD and spectral decomposition ==
=== Singular values, singular vectors, and their relation to the SVD ===
=== Singular values, singular vectors, and their relation to the SVD ===
A non-negative real number {{tmath|\sigma}} is a '''[[singular value]]''' for {{tmath|\mathbf M}} if and only if there exist unit-length vectors {{tmath|\mathbf u}} in {{tmath|K^m}} and {{tmath|\mathbf v}} in {{tmath|K^n}} such that
A non-negative real number {{tmath|\sigma}} is a '''[[singular value]]''' for {{tmath|\mathbf M}} if and only if there exist [[unit vector]]s {{tmath|\mathbf u}} in {{tmath|K^m}} and {{tmath|\mathbf v}} in {{tmath|K^n}} such that
 
<math display=block>\begin{align}
<math display=block>\begin{align}
\mathbf{M v} &= \sigma \mathbf{u}, \\[3mu]
\mathbf{M v} &= \sigma \mathbf{u}, \\[3mu]
Line 181: Line 171:


In any singular value decomposition
In any singular value decomposition
<math display=block>
<math display=block>
\mathbf M = \mathbf U \mathbf \Sigma \mathbf V^*
\mathbf M = \mathbf U \mathbf \Sigma \mathbf V^*
</math>
</math>
the diagonal entries of {{tmath|\mathbf \Sigma}} are equal to the singular values of {{tmath|\mathbf M.}} The first {{tmath|p {{=}} \min(m,n)}} columns of {{tmath|\mathbf U}} and {{tmath|\mathbf V}} are, respectively, left- and right-singular vectors for the corresponding singular values.  Consequently, the above theorem implies that:
the diagonal entries of {{tmath|\mathbf \Sigma}} are equal to the singular values of {{tmath|\mathbf M.}} The first {{tmath|p {{=}} \min(m,n)}} columns of {{tmath|\mathbf U}} and {{tmath|\mathbf V}} are, respectively, left- and right-singular vectors for the corresponding singular values.  Consequently, the above theorem implies that:
* An {{tmath|m \times n}} matrix {{tmath|\mathbf M}} has at most {{tmath|p}} distinct singular values.
* An {{tmath|m \times n}} matrix {{tmath|\mathbf M}} has at most {{tmath|p}} distinct singular values.
Line 202: Line 190:


If {{tmath|\mathbf M}} has SVD {{tmath|\mathbf M  {{=}} \mathbf U \mathbf \Sigma \mathbf V^*,}} the following two relations hold:
If {{tmath|\mathbf M}} has SVD {{tmath|\mathbf M  {{=}} \mathbf U \mathbf \Sigma \mathbf V^*,}} the following two relations hold:
<math display=block>\begin{align}
<math display=block>\begin{align}
\mathbf{M}^* \mathbf{M} &= \mathbf{V} \mathbf \Sigma^* \mathbf{U}^*\, \mathbf{U} \mathbf \Sigma \mathbf{V}^* = \mathbf{V} (\mathbf \Sigma^* \mathbf \Sigma) \mathbf{V}^*, \\[3mu]
\mathbf{M}^* \mathbf{M} &= \mathbf{V} \mathbf \Sigma^* \mathbf{U}^*\, \mathbf{U} \mathbf \Sigma \mathbf{V}^* = \mathbf{V} (\mathbf \Sigma^* \mathbf \Sigma) \mathbf{V}^*, \\[3mu]
Line 222: Line 209:
===Pseudoinverse===
===Pseudoinverse===
The singular value decomposition can be used for computing the [[Moore–Penrose pseudoinverse|pseudoinverse]] of a matrix. The pseudoinverse of the matrix {{tmath|\mathbf M}} with singular value decomposition {{tmath|\mathbf M {{=}} \mathbf U \mathbf \Sigma \mathbf V^*}} is
The singular value decomposition can be used for computing the [[Moore–Penrose pseudoinverse|pseudoinverse]] of a matrix. The pseudoinverse of the matrix {{tmath|\mathbf M}} with singular value decomposition {{tmath|\mathbf M {{=}} \mathbf U \mathbf \Sigma \mathbf V^*}} is
<math display=block>
<math display=block>
\mathbf M^+ = \mathbf  V \boldsymbol \Sigma^+ \mathbf U^\ast,
\mathbf M^+ = \mathbf  V \boldsymbol \Sigma^+ \mathbf U^\ast,
</math>
</math>
where <math>\boldsymbol \Sigma^+</math> is the pseudoinverse of <math>\boldsymbol \Sigma</math>, which is formed by replacing every non-zero diagonal entry by its [[Multiplicative inverse|reciprocal]] and transposing the resulting matrix. The pseudoinverse is one way to solve [[linear least squares (mathematics)|linear least squares]] problems.
where <math>\boldsymbol \Sigma^+</math> is the pseudoinverse of <math>\boldsymbol \Sigma</math>, which is formed by replacing every non-zero diagonal entry by its [[Multiplicative inverse|reciprocal]] and transposing the resulting matrix. The pseudoinverse is one way to solve [[linear least squares (mathematics)|linear least squares]] problems.


===Solving homogeneous linear equations===
===Solving homogeneous linear equations===
A set of [[homogeneous linear equation]]s can be written as {{tmath|\mathbf A \mathbf x {{=}} \mathbf 0}} for a matrix {{tmath|\mathbf A}} and vector {{tmath|\mathbf x.}} A typical situation is that {{tmath|\mathbf A}} is known and a non-zero {{tmath|\mathbf x}} is to be determined which satisfies the equation. Such an {{tmath|\mathbf x}} belongs to {{tmath|\mathbf A}}'s [[Kernel (matrix)|null space]] and is sometimes called a (right) null vector of {{tmath|\mathbf A.}} The vector {{tmath|\mathbf x}} can be characterized as a right-singular vector corresponding to a singular value of {{tmath|\mathbf A}} that is zero. This observation means that if {{tmath|\mathbf A}} is a [[square matrix]] and has no vanishing singular value, the equation has no non-zero {{tmath|\mathbf x}} as a solution.  It also means that if there are several vanishing singular values, any linear combination of the corresponding right-singular vectors is a valid solution. Analogously to the definition of a (right) null vector, a non-zero {{tmath|\mathbf x}} satisfying {{tmath|\mathbf x^* \mathbf A {{=}} \mathbf 0}} with {{tmath|\mathbf x^*}} denoting the conjugate transpose of {{tmath|\mathbf x,}} is called a left null vector of {{tmath|\mathbf A.}}
A set of [[homogeneous linear equation]]s can be written as {{tmath|\mathbf A \mathbf x {{=}} \mathbf 0}} for a matrix {{tmath|\mathbf A}}, vector {{tmath|\mathbf x}}, and [[zero vector]] {{tmath|\mathbf 0}}. A typical situation is that {{tmath|\mathbf A}} is known and a non-zero {{tmath|\mathbf x}} is to be determined which satisfies the equation. Such an {{tmath|\mathbf x}} belongs to {{tmath|\mathbf A}}'s [[Kernel (matrix)|null space]] and is sometimes called a (right) null vector of {{tmath|\mathbf A.}} The vector {{tmath|\mathbf x}} can be characterized as a right-singular vector corresponding to a singular value of {{tmath|\mathbf A}} that is zero. This observation means that if {{tmath|\mathbf A}} is a [[square matrix]] and has no vanishing singular value, the equation has no non-zero {{tmath|\mathbf x}} as a solution.  It also means that if there are several vanishing singular values, any linear combination of the corresponding right-singular vectors is a valid solution. Analogously to the definition of a (right) null vector, a non-zero {{tmath|\mathbf x}} satisfying {{tmath|\mathbf x^* \mathbf A {{=}} \mathbf 0}} with {{tmath|\mathbf x^*}} denoting the conjugate transpose of {{tmath|\mathbf x}} is called a left null vector of {{tmath|\mathbf A.}}


===Total least squares minimization===
===Total least squares minimization===
Line 242: Line 227:
===Low-rank matrix approximation===
===Low-rank matrix approximation===
Some practical applications need to solve the problem of [[Low-rank approximation|approximating]] a matrix {{tmath|\mathbf M}} with another matrix <math>\tilde{\mathbf{M}}</math>, said to be [[#Truncated SVD|truncated]], which has a specific rank {{tmath|r}}. In the case that the approximation is based on minimizing the [[Frobenius norm]] of the difference between {{tmath|\mathbf M}} and {{tmath|\tilde{\mathbf M} }} under the constraint that <math>\operatorname{rank}\bigl(\tilde{\mathbf{M}}\bigr) = r,</math> it turns out that the solution is given by the SVD of {{tmath|\mathbf M,}} namely
Some practical applications need to solve the problem of [[Low-rank approximation|approximating]] a matrix {{tmath|\mathbf M}} with another matrix <math>\tilde{\mathbf{M}}</math>, said to be [[#Truncated SVD|truncated]], which has a specific rank {{tmath|r}}. In the case that the approximation is based on minimizing the [[Frobenius norm]] of the difference between {{tmath|\mathbf M}} and {{tmath|\tilde{\mathbf M} }} under the constraint that <math>\operatorname{rank}\bigl(\tilde{\mathbf{M}}\bigr) = r,</math> it turns out that the solution is given by the SVD of {{tmath|\mathbf M,}} namely
<math display=block>
<math display=block>
\tilde{\mathbf{M}} = \mathbf{U} \tilde{\mathbf \Sigma} \mathbf{V}^*,
\tilde{\mathbf{M}} = \mathbf{U} \tilde{\mathbf \Sigma} \mathbf{V}^*,
</math>
</math>
where <math>\tilde{\mathbf \Sigma}</math> is the same matrix as <math>\mathbf \Sigma</math> except that it contains only the {{tmath|r}} largest singular values (the other singular values are replaced by zero). This is known as the '''[[Low-rank approximation|Eckart–Young theorem]]''', as it was proved by those two authors in 1936.{{efn|Although, it was later found to have been known to earlier authors; see {{harvp|Stewart|1993}}.}}


where <math>\tilde{\mathbf \Sigma}</math> is the same matrix as <math>\mathbf \Sigma</math> except that it contains only the {{tmath|r}} largest singular values (the other singular values are replaced by zero). This is known as the '''[[Low-rank approximation|Eckart–Young theorem]]''', as it was proved by those two authors in 1936 (although it was later found to have been known to earlier authors; see {{harvnb|Stewart|1993}}).
=== Image compression ===
=== Image compression ===
[[File:Svd compression.jpg|thumb|Singular-value decomposition (SVD) image compression of a 1996 Chevrolet Corvette photograph. The original RGB image (upper-left) is compared with rank 1, 10, and 100 reconstructions.|292x292px]]One practical consequence of the low-rank approximation given by SVD is that a [[greyscale image]] represented as an <math>m \times n</math> matrix <math>\mathbf{A}</math>, can be efficiently represented by keeping the first <math>k</math> singular values and corresponding vectors. The truncated decomposition
[[File:Svd compression.jpg|thumb|Singular-value decomposition (SVD) image compression of a 1996 Chevrolet Corvette photograph. The original RGB image (upper-left) is compared with rank 1, 10, and 100 reconstructions.|292x292px]]One practical consequence of the low-rank approximation given by SVD is that a [[greyscale image]] represented as an <math>m \times n</math> matrix <math>\mathbf{A}</math>, can be efficiently represented by keeping the first <math>k</math> singular values and corresponding vectors. The truncated decomposition
<math>\mathbf{A}_k = \sum_{j=1}^k \sigma_j\mathbf{u}_j \mathbf{v}_j^T  </math>
<math>\mathbf{A}_k = \sum_{j=1}^k \sigma_j\mathbf{u}_j \mathbf{v}_j^T  </math>
gives an image with the best 2-norm error out of all rank k approximations. Thus, the task becomes finding an approximation that balances retaining perceptual fidelity with the number of vectors required to reconstruct the image. Storing <math>\mathbf{A}_k</math> requires only <math>k(n + m + 1)</math> floating-point numbers compared to <math>nm</math> integers. This same idea extends to color images by applying this operation to each channel or stacking the channels into one matrix.
gives an image with the best 2-norm error out of all rank k approximations. Thus, the task becomes finding an approximation that balances retaining perceptual fidelity with the number of vectors required to reconstruct the image. Storing <math>\mathbf{A}_k</math> requires only <math>k(n + m + 1)</math> floating-point numbers compared to <math>nm</math> integers. This same idea extends to color images by applying this operation to each channel or stacking the channels into one matrix.


Line 274: Line 256:


===Nearest orthogonal matrix===
===Nearest orthogonal matrix===
It is possible to use the SVD of a square matrix {{tmath|\mathbf A}} to determine the [[orthogonal matrix]] {{tmath|\mathbf O}} closest to {{tmath|\mathbf A.}} The closeness of fit is measured by the [[Frobenius norm]] of {{tmath|\mathbf O - \mathbf A.}} The solution is the product {{tmath|\mathbf U \mathbf V^*.}}<ref>[http://www.wou.edu/~beavers/Talks/Willamette1106.pdf The Singular Value Decomposition in Symmetric (Lowdin) Orthogonalization and Data Compression]</ref> This intuitively makes sense because an orthogonal matrix would have the decomposition {{tmath|\mathbf U \mathbf I \mathbf V^*}} where {{tmath|\mathbf I}} is the identity matrix, so that if {{tmath|\mathbf A {{=}} \mathbf U \mathbf \Sigma \mathbf V^*}} then the product {{tmath|\mathbf A {{=}} \mathbf U \mathbf V^*}} amounts to replacing the singular values with ones.  Equivalently, the solution is the unitary matrix {{tmath|\mathbf R {{=}} \mathbf U \mathbf V^*}} of the Polar Decomposition <math>\mathbf M = \mathbf R \mathbf P = \mathbf P' \mathbf R</math> in either order of stretch and rotation, as described above.
It is possible to use the SVD of a square matrix {{tmath|\mathbf A}} to determine the [[orthogonal matrix]] {{tmath|\mathbf Q}} closest to {{tmath|\mathbf A.}} The closeness of fit is measured by the [[Frobenius norm]] of {{tmath|\mathbf Q - \mathbf A.}} The solution is the product {{tmath|\mathbf U \mathbf V^*.}}<ref>[https://people.wou.edu/~beavers/Talks/Willamette1106.pdf The Singular Value Decomposition in Symmetric (Lowdin) Orthogonalization and Data Compression]</ref>{{sfnp|Golub|Van Loan|1996|loc=§12.4}} This intuitively makes sense because an orthogonal matrix would have the decomposition {{tmath|\mathbf U \mathbf I \mathbf V^*}} where {{tmath|\mathbf I}} is the identity matrix, so that if {{tmath|\mathbf A {{=}} \mathbf U \mathbf \Sigma \mathbf V^*}} then the product {{tmath|\mathbf A {{=}} \mathbf U \mathbf V^*}} amounts to replacing the singular values with ones.  Equivalently, the solution is the unitary matrix {{tmath|\mathbf R {{=}} \mathbf U \mathbf V^*}} of the Polar Decomposition <math>\mathbf M = \mathbf R \mathbf P = \mathbf P' \mathbf R</math> in either order of stretch and rotation, as described above.
 
A similar problem, with interesting applications in [[shape analysis (digital geometry)|shape analysis]], is the [[orthogonal Procrustes problem]], which consists of finding an orthogonal matrix {{tmath|\mathbf O}} which most closely maps {{tmath|\mathbf A}} to {{tmath|\mathbf B.}} Specifically,


A similar problem, with interesting applications in [[shape analysis (digital geometry)|shape analysis]], is the [[orthogonal Procrustes problem]], which consists of finding an orthogonal matrix {{tmath|\mathbf Q}} which most closely maps {{tmath|\mathbf A}} to {{tmath|\mathbf B.}} Specifically,
<math display=block>
<math display=block>
\mathbf{O} = \underset\Omega\operatorname{argmin} \|\mathbf{A}\boldsymbol{\Omega} - \mathbf{B}\|_F \quad\text{subject to}\quad \boldsymbol{\Omega}^\operatorname{T}\boldsymbol{\Omega} = \mathbf{I},
\mathbf Q = \underset\Omega\operatorname{argmin} \|\mathbf{A}\boldsymbol{\Omega} - \mathbf{B}\|_F \quad\text{subject to}\quad \boldsymbol{\Omega}^\operatorname{T}\boldsymbol{\Omega} = \mathbf{I},
</math>
</math>
where <math>\| \cdot \|_F</math> denotes the Frobenius norm.
where <math>\| \cdot \|_F</math> denotes the Frobenius norm.


Line 290: Line 270:


===Principal Component Analysis===
===Principal Component Analysis===
The SVD can be used to construct the principal components<ref>{{cite book |last=Hastie |first=Trevor |author2=Robert Tibshirani |author3=Jerome Friedman |title=The Elements of Statistical Learning |edition=2nd |year=2009 |publisher=Springer |location=New York |pages=535–536 |isbn=978-0-387-84857-0}}</ref> in [[principal component analysis]] as follows:
The SVD can be used to construct the principal components in [[principal component analysis]] as follows:{{sfnp|Hastie|Tibshirani|Friedman|2009|pp=535–536}}


Let <math>\mathbf{X} \in \mathbb{R}^{N \times p}</math> be a data matrix where each of the <math>N</math> rows is a (feature-wise) mean-centered observation, each of dimension <math>p</math>.
Let <math>\mathbf{X} \in \mathbb{R}^{N \times p}</math> be a data matrix where each of the <math>N</math> rows is a (feature-wise) mean-centered observation, each of dimension <math>p</math>.
Line 299: Line 279:
</math>
</math>


From the same reference,<ref>{{cite book |last=Hastie |first=Trevor |author2=Robert Tibshirani |author3=Jerome Friedman |title=The Elements of Statistical Learning |edition=2nd |year=2009 |publisher=Springer |location=New York |pages=535–536 |isbn=978-0-387-84857-0}}</ref> we see that <math>\mathbf{V} \boldsymbol{\Sigma}</math> contains the scores of the rows of <math>\mathbf{X}</math> (i.e. each observation), and <math>\mathbf{U}</math> is the matrix whose columns are principal component loading vectors.
We see that <math>\mathbf{V} \boldsymbol{\Sigma}</math> contains the scores of the rows of <math>\mathbf{X}</math> (i.e. each observation), and <math>\mathbf{U}</math> is the matrix whose columns are principal component loading vectors.{{sfnp|Hastie|Tibshirani|Friedman|2009|pp=535–536}}


===Signal processing===
===Signal processing===
The SVD and pseudoinverse have been successfully applied to [[signal processing]],<ref>{{cite journal |last=Sahidullah |first=Md. |author2=Kinnunen, Tomi |title=Local spectral variability features for speaker verification |journal=Digital Signal Processing |date=March 2016 |volume=50 |pages=1–11 |doi=10.1016/j.dsp.2015.10.011 |bibcode=2016DSP....50....1S |url= https://erepo.uef.fi/handle/123456789/4375}}<!--https://erepo.uef.fi/handle/123456789/4375--></ref> [[image processing]]<ref name="Mademlis2018">{{cite book |last1=Mademlis |first1=Ioannis |last2=Tefas |first2=Anastasios |last3=Pitas |first3=Ioannis |title=2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) |chapter=Regularized SVD-Based Video Frame Saliency for Unsupervised Activity Video Summarization |url=https://ieeexplore.ieee.org/document/8462274  |year=2018 |pages=2691–2695 |publisher=IEEE |doi=10.1109/ICASSP.2018.8462274 |isbn=978-1-5386-4658-8 |s2cid=52286352 |access-date=19 January 2023}}</ref> and [[big data]] (e.g., in genomic signal processing).<ref>
The SVD and pseudoinverse have been successfully applied to [[signal processing]],<ref>{{cite journal |last=Sahidullah |first=Md. |author2=Kinnunen, Tomi |title=Local spectral variability features for speaker verification |journal=Digital Signal Processing |date=March 2016 |volume=50 |pages=1–11 |doi=10.1016/j.dsp.2015.10.011 |bibcode=2016DSP....50....1S |url= https://erepo.uef.fi/handle/123456789/4375}}<!--https://erepo.uef.fi/handle/123456789/4375--></ref> [[image processing]]<ref name="Mademlis2018">{{cite book |last1=Mademlis |first1=Ioannis |last2=Tefas |first2=Anastasios |last3=Pitas |first3=Ioannis |title=2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) |chapter=Regularized SVD-Based Video Frame Saliency for Unsupervised Activity Video Summarization |year=2018 |pages=2691–2695 |publisher=IEEE |doi=10.1109/ICASSP.2018.8462274 |isbn=978-1-5386-4658-8 |s2cid=52286352 }}</ref> and [[big data]] (e.g., in genomic signal processing).<ref>
{{Cite journal
{{Cite journal
  | author = O. Alter, P. O. Brown and D. Botstein
  | last1 = Alter |first1= O. |last2= Brown |first2= P. O. |last3= Botstein |first3= D.
| date = September 2000
  | title = Singular Value Decomposition for Genome-Wide Expression Data Processing and Modeling
  | title = Singular Value Decomposition for Genome-Wide Expression Data Processing and Modeling
  | journal = PNAS
  | journal = PNAS
Line 310: Line 291:
  | issue = 18
  | issue = 18
  | pages = 10101–10106
  | pages = 10101–10106
| date = September 2000
  | doi = 10.1073/pnas.97.18.10101
  | doi = 10.1073/pnas.97.18.10101
  | pmid = 10963673
  | pmid = 10963673
Line 317: Line 297:
| doi-access = free
| doi-access = free
  }}</ref><ref>{{Cite journal
  }}</ref><ref>{{Cite journal
  | author1 = O. Alter | author2 = G. H. Golub
  | last1= Alter |first1= O. |last2 = Golub |first2= G. H.
| date = November 2004
  | title = Integrative Analysis of Genome-Scale Data by Using Pseudoinverse Projection Predicts Novel Correlation Between DNA Replication and RNA Transcription
  | title = Integrative Analysis of Genome-Scale Data by Using Pseudoinverse Projection Predicts Novel Correlation Between DNA Replication and RNA Transcription
  | journal = PNAS
  | journal = PNAS
Line 323: Line 304:
  | issue = 47
  | issue = 47
  | pages = 16577–16582
  | pages = 16577–16582
| date = November 2004
  | doi = 10.1073/pnas.0406767101
  | doi = 10.1073/pnas.0406767101
  | pmid = 15545604
  | pmid = 15545604
Line 330: Line 310:
| doi-access = free
| doi-access = free
  }}</ref><ref>{{Cite journal
  }}</ref><ref>{{Cite journal
  | author1 = O. Alter | author2 = G. H. Golub
  | last1= Alter |first1= O. |last2 = Golub |first2= G. H.
| date = August 2006
  | title = Singular Value Decomposition of Genome-Scale mRNA Lengths Distribution Reveals Asymmetry in RNA Gel Electrophoresis Band Broadening
  | title = Singular Value Decomposition of Genome-Scale mRNA Lengths Distribution Reveals Asymmetry in RNA Gel Electrophoresis Band Broadening
  | journal = PNAS
  | journal = PNAS
Line 336: Line 317:
  | issue = 32
  | issue = 32
  | pages = 11828–11833
  | pages = 11828–11833
| date = August 2006
  | doi = 10.1073/pnas.0604756103
  | doi = 10.1073/pnas.0604756103
  | pmid = 16877539
  | pmid = 16877539
Line 343: Line 323:
| doi-access = free
| doi-access = free
  }}</ref><ref>{{Cite journal
  }}</ref><ref>{{Cite journal
  | first1 = N. M.
  | last1= Bertagnolli |first1= N. M. |last2= Drake |first2= J. A. |last3= Tennessen |first3= J. M. |last4= Alter |first4= O.
| last1 = Bertagnolli
  | date = November 2013
| first2 = J. A.
| last2 = Drake
| first3 = J. M.
| last3 = Tennessen
| first4 = O.
  | last4 = Alter
  | title = SVD Identifies Transcript Length Distribution Functions from DNA Microarray Data and Reveals Evolutionary Forces Globally Affecting GBM Metabolism
  | title = SVD Identifies Transcript Length Distribution Functions from DNA Microarray Data and Reveals Evolutionary Forces Globally Affecting GBM Metabolism
  | journal = PLOS ONE
  | journal = PLOS ONE
  | volume = 8
  | volume = 8
  | issue = 11
  | issue = 11
  | pages = e78913
  | article-number = e78913
| date = November 2013
  | doi = 10.1371/journal.pone.0078913
  | doi = 10.1371/journal.pone.0078913
  | id = [http://www.alterlab.org/research/highlights/pone.0078913_Highlight.pdf Highlight]
  | id = [http://www.alterlab.org/research/highlights/pone.0078913_Highlight.pdf Highlight]
Line 376: Line 349:
SVD has also been applied to reduced order modelling. The aim of reduced order modelling is to reduce the number of degrees of freedom in a complex system which is to be modeled. SVD was coupled with [[radial basis functions]] to interpolate solutions to three-dimensional unsteady flow problems.<ref>{{cite journal | last1 = Walton | first1 = S. | last2 = Hassan | first2 = O. | last3 = Morgan | first3 = K. | year = 2013| title = Reduced order modelling for unsteady fluid flow using proper orthogonal decomposition and radial basis functions | journal = Applied Mathematical Modelling | volume =  37| issue = 20–21| pages = 8930–8945| doi=10.1016/j.apm.2013.04.025| doi-access = free }}</ref>
SVD has also been applied to reduced order modelling. The aim of reduced order modelling is to reduce the number of degrees of freedom in a complex system which is to be modeled. SVD was coupled with [[radial basis functions]] to interpolate solutions to three-dimensional unsteady flow problems.<ref>{{cite journal | last1 = Walton | first1 = S. | last2 = Hassan | first2 = O. | last3 = Morgan | first3 = K. | year = 2013| title = Reduced order modelling for unsteady fluid flow using proper orthogonal decomposition and radial basis functions | journal = Applied Mathematical Modelling | volume =  37| issue = 20–21| pages = 8930–8945| doi=10.1016/j.apm.2013.04.025| doi-access = free }}</ref>


Interestingly, SVD has been used to improve gravitational waveform modeling by the ground-based gravitational-wave interferometer aLIGO.<ref>{{cite journal | last1 = Setyawati | first1 = Y. | last2 = Ohme | first2 = F. | last3 = Khan | first3 = S. | year = 2019| title = Enhancing gravitational waveform model through dynamic calibration | journal = Physical Review D | volume =  99| issue =2 | pages = 024010| doi=10.1103/PhysRevD.99.024010| bibcode = 2019PhRvD..99b4010S | arxiv = 1810.07060 | s2cid = 118935941 }}</ref> SVD can help to increase the accuracy and speed of waveform generation to support gravitational-waves searches and update two different waveform models.
Interestingly, SVD has been used to improve gravitational waveform modeling by the ground-based gravitational-wave interferometer aLIGO.<ref>{{cite journal | last1 = Setyawati | first1 = Y. | last2 = Ohme | first2 = F. | last3 = Khan | first3 = S. | year = 2019| title = Enhancing gravitational waveform model through dynamic calibration | journal = Physical Review D | volume =  99| issue =2 | article-number = 024010| doi=10.1103/PhysRevD.99.024010| bibcode = 2019PhRvD..99b4010S | arxiv = 1810.07060 | s2cid = 118935941 }}</ref> SVD can help to increase the accuracy and speed of waveform generation to support gravitational-waves searches and update two different waveform models.


Singular value decomposition is used in [[recommender systems]] to predict people's item ratings.<ref>{{cite report |last1=Sarwar |first1=Badrul |last2=Karypis |first2=George |last3=Konstan |first3=Joseph A. |author3-link=Joseph A. Konstan |last4=Riedl |first4=John T. |author4-link=John T. Riedl |name-list-style=amp |year=2000 |title=Application of Dimensionality Reduction in Recommender System – A Case Study |url=https://apps.dtic.mil/sti/citations/tr/ADA439541 |journal= |publisher=[[University of Minnesota]]|hdl=11299/215429|type=Technical report 00-043}}</ref> Distributed algorithms have been developed for the purpose of calculating the SVD on clusters of commodity machines.<ref>{{cite arXiv |last1=Bosagh Zadeh |first1=Reza |last2=Carlsson |first2=Gunnar |title=Dimension Independent Matrix Square Using MapReduce |year=2013 |class=cs.DS |eprint=1304.1467}}</ref>
Singular value decomposition is used in [[recommender systems]] to predict people's item ratings.<ref>{{cite report |last1=Sarwar |first1=Badrul |last2=Karypis |first2=George |last3=Konstan |first3=Joseph A. |author3-link=Joseph A. Konstan |last4=Riedl |first4=John T. |author4-link=John T. Riedl |name-list-style=amp |year=2000 |title=Application of Dimensionality Reduction in Recommender System – A Case Study |url=https://apps.dtic.mil/sti/citations/tr/ADA439541 |journal= |publisher=[[University of Minnesota]]|hdl=11299/215429|type=Technical report 00-043}}</ref> Distributed algorithms have been developed for the purpose of calculating the SVD on clusters of commodity machines.<ref>{{cite arXiv |last1=Bosagh Zadeh |first1=Reza |last2=Carlsson |first2=Gunnar |title=Dimension Independent Matrix Square Using MapReduce |year=2013 |class=cs.DS |eprint=1304.1467}}</ref>


Low-rank SVD has been applied for hotspot detection from spatiotemporal data with application to disease [[outbreak]] detection.<ref>{{Cite journal
Low-rank SVD has been applied for hotspot detection from spatiotemporal data with application to disease [[outbreak]] detection.<ref>{{Cite journal
  |author1=Hadi Fanaee Tork |author2=João Gama
  |last1= Fanaee Tork |first1= Hadi |last2= Gama |first2= João
|date = September 2014
  |title = Eigenspace method for spatiotemporal hotspot detection
  |title = Eigenspace method for spatiotemporal hotspot detection
  |journal = Expert Systems
  |journal = Expert Systems
Line 387: Line 361:
  |issue=3
  |issue=3
  |pages = 454–464
  |pages = 454–464
|date = September 2014
  |doi = 10.1111/exsy.12088
  |doi = 10.1111/exsy.12088
  |arxiv=1406.3506 |bibcode=2014arXiv1406.3506F
  |arxiv=1406.3506 |bibcode=2014arXiv1406.3506F
  |s2cid=15476557
  |s2cid=15476557
  }}</ref> A combination of SVD and [[Higher-order singular value decomposition|higher-order SVD]] also has been applied for real time event detection from complex data streams (multivariate data with space and time dimensions) in [[disease surveillance]].<ref>{{Cite journal
  }}</ref> A combination of SVD and [[Higher-order singular value decomposition|higher-order SVD]] also has been applied for real time event detection from complex data streams (multivariate data with space and time dimensions) in [[disease surveillance]].<ref>{{Cite journal
  |author1=Hadi Fanaee Tork |author2=João Gama
  |last1= Fanaee Tork |first1= Hadi |last2= Gama |first2= João
|date = May 2015
  |title = EigenEvent: An Algorithm for Event Detection from Complex Data Streams in Syndromic Surveillance
  |title = EigenEvent: An Algorithm for Event Detection from Complex Data Streams in Syndromic Surveillance
  |journal = Intelligent Data Analysis
  |journal = Intelligent Data Analysis
Line 398: Line 372:
  |issue = 3
  |issue = 3
  |pages=597–616
  |pages=597–616
|date = May 2015
  |arxiv = 1406.3496
  |arxiv = 1406.3496
  |doi=10.3233/IDA-150734|s2cid=17966555
  |doi=10.3233/IDA-150734|s2cid=17966555
Line 405: Line 378:
In [[astrodynamics]], the SVD and its variants are used as an option to determine suitable maneuver directions for transfer trajectory design<ref name=muralidharan2023stretching>{{Cite journal|title=Stretching directions in cislunar space: Applications for departures and transfer design|first1=Vivek|last1=Muralidharan|first2=Kathleen|last2=Howell|journal =Astrodynamics  | volume = 7 | issue = 2| pages = 153–178 | date = 2023 | doi = 10.1007/s42064-022-0147-z | bibcode = 2023AsDyn...7..153M|s2cid=252637213 }}</ref> and [[orbital station-keeping]].<ref name=Muralidharan2021>{{Cite journal|title=Leveraging stretching directions for stationkeeping in Earth-Moon halo orbits |first1=Vivek|last1=Muralidharan|first2=Kathleen|last2=Howell|journal =[[Advances in Space Research]]  | volume = 69 | issue = 1| pages = 620–646 | date = 2022 | doi = 10.1016/j.asr.2021.10.028 | bibcode = 2022AdSpR..69..620M|s2cid=239490016 }}</ref>
In [[astrodynamics]], the SVD and its variants are used as an option to determine suitable maneuver directions for transfer trajectory design<ref name=muralidharan2023stretching>{{Cite journal|title=Stretching directions in cislunar space: Applications for departures and transfer design|first1=Vivek|last1=Muralidharan|first2=Kathleen|last2=Howell|journal =Astrodynamics  | volume = 7 | issue = 2| pages = 153–178 | date = 2023 | doi = 10.1007/s42064-022-0147-z | bibcode = 2023AsDyn...7..153M|s2cid=252637213 }}</ref> and [[orbital station-keeping]].<ref name=Muralidharan2021>{{Cite journal|title=Leveraging stretching directions for stationkeeping in Earth-Moon halo orbits |first1=Vivek|last1=Muralidharan|first2=Kathleen|last2=Howell|journal =[[Advances in Space Research]]  | volume = 69 | issue = 1| pages = 620–646 | date = 2022 | doi = 10.1016/j.asr.2021.10.028 | bibcode = 2022AdSpR..69..620M|s2cid=239490016 }}</ref>


The SVD can be used to measure the similarity between real-valued matrices.<ref name=albers2025>{{Cite journal|title=Assessing the Similarity of Real Matrices with Arbitrary Shape|first1=Jasper|last1=Albers|first2=Anno|last2=Kurth|first3=Robin|last3=Gutzen|first4=Aitor|last4=Morales-Gregorio|first5=Michael|last5=Denker|first6=Sonja|last6=Gruen|first7=Sacha|last7=van Albada|first8=Markus|last8=Diesmann|journal=PRX Life| issue = 3| pages = 023005 | date = 2025 | doi = 10.1103/PRXLife.3.023005 |arxiv=2403.17687}}</ref> By measuring the angles between the singular vectors, the inherent two-dimensional structure of matrices is accounted for. This method was shown to outperform [[cosine similarity]] and [[Frobenius norm]] in most cases, including brain activity measurements from [[neuroscience]] experiments.
The SVD can be used to measure the similarity between real-valued matrices.<ref name=albers2025>{{Cite journal|title=Assessing the Similarity of Real Matrices with Arbitrary Shape|first1=Jasper|last1=Albers|first2=Anno|last2=Kurth|first3=Robin|last3=Gutzen|first4=Aitor|last4=Morales-Gregorio|first5=Michael|last5=Denker|first6=Sonja|last6=Gruen|first7=Sacha|last7=van Albada|first8=Markus|last8=Diesmann|journal=PRX Life| issue = 2| article-number = 023005 | date = 2025 |volume=3 | doi = 10.1103/PRXLife.3.023005 |arxiv=2403.17687 |bibcode=2025PRXL....3b3005A }}</ref> By measuring the angles between the singular vectors, the inherent two-dimensional structure of matrices is accounted for. This method was shown to outperform [[cosine similarity]] and [[Frobenius norm]] in most cases, including brain activity measurements from [[neuroscience]] experiments.


== Proof of existence ==
== Proof of existence ==
Line 416: Line 389:


By the [[extreme value theorem]], this continuous function attains a maximum at some {{tmath|\mathbf u}} when restricted to the unit sphere <math>\{\|\mathbf x\| = 1\}.</math> By the [[Lagrange multipliers]] theorem, {{tmath|\mathbf u}} necessarily satisfies
By the [[extreme value theorem]], this continuous function attains a maximum at some {{tmath|\mathbf u}} when restricted to the unit sphere <math>\{\|\mathbf x\| = 1\}.</math> By the [[Lagrange multipliers]] theorem, {{tmath|\mathbf u}} necessarily satisfies
 
<math display=block>\nabla \mathbf{u}^\operatorname{T} \mathbf{M} \mathbf{u} - \lambda \cdot \nabla \mathbf{u}^\operatorname{T} \mathbf{u} = \mathbf{0}</math>
<math display=block>\nabla \mathbf{u}^\operatorname{T} \mathbf{M} \mathbf{u} - \lambda \cdot \nabla \mathbf{u}^\operatorname{T} \mathbf{u} = 0</math>
 
for some real number {{tmath|\lambda.}} The nabla symbol, {{tmath|\nabla}}, is the [[del]] operator (differentiation with respect to {{nobr|{{tmath|\mathbf x}}).}} Using the symmetry of {{tmath|\mathbf M}} we obtain
for some real number {{tmath|\lambda.}} The nabla symbol, {{tmath|\nabla}}, is the [[del]] operator (differentiation with respect to {{nobr|{{tmath|\mathbf x}}).}} Using the symmetry of {{tmath|\mathbf M}} we obtain
<math display=block>\nabla \mathbf{x}^\operatorname{T} \mathbf{M} \mathbf{x} - \lambda \cdot \nabla \mathbf{x}^\operatorname{T} \mathbf{x} = 2(\mathbf{M}-\lambda \mathbf{I})\mathbf{x}.</math>
<math display=block>\nabla \mathbf{x}^\operatorname{T} \mathbf{M} \mathbf{x} - \lambda \cdot \nabla \mathbf{x}^\operatorname{T} \mathbf{x} = 2(\mathbf{M}-\lambda \mathbf{I})\mathbf{x}.</math>


Line 431: Line 401:
=== Based on the spectral theorem ===
=== Based on the spectral theorem ===
Let <math>\mathbf{M}</math> be an {{tmath|m \times n}} complex matrix. Since <math>\mathbf{M}^* \mathbf{M}</math> is positive semi-definite and Hermitian, by the [[spectral theorem]], there exists an {{tmath|n \times n}} unitary matrix <math>\mathbf{V}</math> such that
Let <math>\mathbf{M}</math> be an {{tmath|m \times n}} complex matrix. Since <math>\mathbf{M}^* \mathbf{M}</math> is positive semi-definite and Hermitian, by the [[spectral theorem]], there exists an {{tmath|n \times n}} unitary matrix <math>\mathbf{V}</math> such that
<math display=block>
<math display=block>
\mathbf V^* \mathbf M^* \mathbf M \mathbf V
\mathbf V^* \mathbf M^* \mathbf M \mathbf V
Line 437: Line 406:
= \begin{bmatrix} \mathbf{D} & 0 \\ 0 & 0\end{bmatrix},
= \begin{bmatrix} \mathbf{D} & 0 \\ 0 & 0\end{bmatrix},
</math>
</math>
where <math>\mathbf{D}</math> is diagonal and positive definite, of dimension <math>\ell\times \ell</math>, with <math>\ell</math> the number of non-zero eigenvalues of <math>\mathbf{M}^* \mathbf{M}</math> (which can be shown to verify <math>\ell\le\min(n,m)</math>). Note that <math>\mathbf{V}</math> is here by definition a matrix whose <math>i</math>-th column is the <math>i</math>-th eigenvector of <math>\mathbf{M}^* \mathbf{M}</math>, corresponding to the eigenvalue <math>\bar{\mathbf{D}}_{ii}</math>. Moreover, the <math>j</math>-th column of <math>\mathbf{V}</math>, for <math>j>\ell</math>, is an eigenvector of <math>\mathbf{M}^* \mathbf{M}</math> with eigenvalue <math>\bar{\mathbf{D}}_{jj}=0</math>. This can be expressed by writing <math>\mathbf{V}</math>  as <math>\mathbf{V}=\begin{bmatrix}\mathbf{V}_1 &\mathbf{V}_2\end{bmatrix}</math>, where the columns of <math>\mathbf{V}_1</math> and <math>\mathbf{V}_2</math> therefore contain the eigenvectors of <math>\mathbf{M}^* \mathbf{M}</math> corresponding to non-zero and zero eigenvalues, respectively. Using this rewriting of <math>\mathbf{V}</math>, the equation becomes:
where <math>\mathbf{D}</math> is diagonal and positive definite, of dimension <math>\ell\times \ell</math>, with <math>\ell</math> the number of non-zero eigenvalues of <math>\mathbf{M}^* \mathbf{M}</math> (which can be shown to verify <math>\ell\le\min(n,m)</math>). Note that <math>\mathbf{V}</math> is here by definition a matrix whose <math>i</math>-th column is the <math>i</math>-th eigenvector of <math>\mathbf{M}^* \mathbf{M}</math>, corresponding to the eigenvalue <math>\bar{\mathbf{D}}_{ii}</math>. Moreover, the <math>j</math>-th column of <math>\mathbf{V}</math>, for <math>j>\ell</math>, is an eigenvector of <math>\mathbf{M}^* \mathbf{M}</math> with eigenvalue <math>\bar{\mathbf{D}}_{jj}=0</math>. This can be expressed by writing <math>\mathbf{V}</math>  as <math>\mathbf{V}=\begin{bmatrix}\mathbf{V}_1 &\mathbf{V}_2\end{bmatrix}</math>, where the columns of <math>\mathbf{V}_1</math> and <math>\mathbf{V}_2</math> therefore contain the eigenvectors of <math>\mathbf{M}^* \mathbf{M}</math> corresponding to non-zero and zero eigenvalues, respectively. Using this rewriting of <math>\mathbf{V}</math>, the equation becomes:
<math display=block>
<math display=block>
\begin{bmatrix} \mathbf{V}_1^* \\ \mathbf{V}_2^* \end{bmatrix}
\begin{bmatrix} \mathbf{V}_1^* \\ \mathbf{V}_2^* \end{bmatrix}
Line 450: Line 417:


This implies that
This implies that
<math display=block>
<math display=block>
\mathbf{V}_1^* \mathbf{M}^* \mathbf{M} \mathbf{V}_1
\mathbf{V}_1^* \mathbf{M}^* \mathbf{M} \mathbf{V}_1
Line 457: Line 423:
</math>
</math>


Moreover, the second equation implies <math>\mathbf{M}\mathbf{V}_2 = \mathbf{0}</math>.<ref>To see this, we just have to notice that <math>\operatorname{Tr}(\mathbf{V}_2^* \mathbf{M}^* \mathbf{M} \mathbf{V}_2) = \|\mathbf{M} \mathbf{V}_2\|^2</math>, and remember that <math>\|A\| = 0 \Leftrightarrow A = 0</math>.</ref> Finally, the unitary-ness of <math>\mathbf{V}</math> translates, in terms of <math>\mathbf{V}_1</math> and <math>\mathbf{V}_2</math>, into the following conditions:
Moreover, the second equation implies <math>\mathbf{M}\mathbf{V}_2 = \mathbf{0}</math>.{{efn|To see this, we just have to notice that <math display=inline>\operatorname{Tr}(\mathbf{V}_2^* \mathbf{M}^* \mathbf{M} \mathbf{V}_2) = \|\mathbf{M} \mathbf{V}_2\|^2,</math> and remember that <math>\|A\| = 0 \Leftrightarrow A = 0</math>.}} Finally, the unitary-ness of <math>\mathbf{V}</math> translates, in terms of <math>\mathbf{V}_1</math> and <math>\mathbf{V}_2</math>, into the following conditions:
 
<math display=block>\begin{align}  
<math display=block>\begin{align}  
\mathbf{V}_1^* \mathbf{V}_1 &= \mathbf{I}_1, \\
\mathbf{V}_1^* \mathbf{V}_1 &= \mathbf{I}_1, \\
Line 464: Line 429:
\mathbf{V}_1 \mathbf{V}_1^* + \mathbf{V}_2 \mathbf{V}_2^* &= \mathbf{I}_{12},
\mathbf{V}_1 \mathbf{V}_1^* + \mathbf{V}_2 \mathbf{V}_2^* &= \mathbf{I}_{12},
\end{align}</math>
\end{align}</math>
where the subscripts on the identity matrices are used to remark that they are of different dimensions.
where the subscripts on the identity matrices are used to remark that they are of different dimensions.


Let us now define
Let us now define
<math display=block>
<math display=block>
\mathbf{U}_1 = \mathbf{M} \mathbf{V}_1 \mathbf{D}^{-\frac{1}{2}}.
\mathbf{U}_1 = \mathbf{M} \mathbf{V}_1 \mathbf{D}^{-\frac{1}{2}}.
Line 474: Line 437:


Then,
Then,
<math display=block>
<math display=block>
\mathbf{U}_1 \mathbf{D}^\frac{1}{2} \mathbf{V}_1^* = \mathbf{M} \mathbf{V}_1 \mathbf{D}^{-\frac{1}{2}} \mathbf{D}^\frac{1}{2} \mathbf{V}_1^* = \mathbf{M} (\mathbf{I} - \mathbf{V}_2\mathbf{V}_2^*) = \mathbf{M} - (\mathbf{M}\mathbf{V}_2)\mathbf{V}_2^* = \mathbf{M},
\mathbf{U}_1 \mathbf{D}^\frac{1}{2} \mathbf{V}_1^* = \mathbf{M} \mathbf{V}_1 \mathbf{D}^{-\frac{1}{2}} \mathbf{D}^\frac{1}{2} \mathbf{V}_1^* = \mathbf{M} (\mathbf{I} - \mathbf{V}_2\mathbf{V}_2^*) = \mathbf{M} - (\mathbf{M}\mathbf{V}_2)\mathbf{V}_2^* = \mathbf{M},
Line 482: Line 444:


We see that this is almost the desired result, except that <math>\mathbf{U}_1</math> and <math>\mathbf{V}_1</math> are in general not unitary, since they might not be square. However, we do know that the number of rows of <math>\mathbf{U}_1</math> is no smaller than the number of columns, since the dimensions of <math>\mathbf{D}</math> is no greater than <math>m</math> and <math>n</math>. Also, since
We see that this is almost the desired result, except that <math>\mathbf{U}_1</math> and <math>\mathbf{V}_1</math> are in general not unitary, since they might not be square. However, we do know that the number of rows of <math>\mathbf{U}_1</math> is no smaller than the number of columns, since the dimensions of <math>\mathbf{D}</math> is no greater than <math>m</math> and <math>n</math>. Also, since
<math display=block>
<math display=block>
\mathbf{U}_1^*\mathbf{U}_1 = \mathbf{D}^{-\frac{1}{2}}\mathbf{V}_1^*\mathbf{M}^*\mathbf{M} \mathbf{V}_1 \mathbf{D}^{-\frac{1}{2}}=\mathbf{D}^{-\frac{1}{2}}\mathbf{D}\mathbf{D}^{-\frac{1}{2}} = \mathbf{I_1},
\mathbf{U}_1^*\mathbf{U}_1 = \mathbf{D}^{-\frac{1}{2}}\mathbf{V}_1^*\mathbf{M}^*\mathbf{M} \mathbf{V}_1 \mathbf{D}^{-\frac{1}{2}}=\mathbf{D}^{-\frac{1}{2}}\mathbf{D}\mathbf{D}^{-\frac{1}{2}} = \mathbf{I_1},
</math>
</math>
the columns in <math>\mathbf{U}_1</math> are orthonormal and can be extended to an orthonormal basis. This means that we can choose <math>\mathbf{U}_2</math> such that <math>\mathbf{U} = \begin{bmatrix} \mathbf{U}_1 & \mathbf{U}_2 \end{bmatrix}</math> is unitary.
the columns in <math>\mathbf{U}_1</math> are orthonormal and can be extended to an orthonormal basis. This means that we can choose <math>\mathbf{U}_2</math> such that <math>\mathbf{U} = \begin{bmatrix} \mathbf{U}_1 & \mathbf{U}_2 \end{bmatrix}</math> is unitary.


For {{tmath|\mathbf V_1}} we already have {{tmath|\mathbf V_2}} to make it unitary. Now, define
For {{tmath|\mathbf V_1}} we already have {{tmath|\mathbf V_2}} to make it unitary. Now, define
<math display=block>
<math display=block>
\mathbf \Sigma =
\mathbf \Sigma =
Line 500: Line 459:


where extra zero rows are added '''or removed''' to make the number of zero rows equal the number of columns of {{tmath|\mathbf U_2,}} and hence the overall dimensions of <math>\mathbf \Sigma</math> equal to <math>m\times n</math>. Then
where extra zero rows are added '''or removed''' to make the number of zero rows equal the number of columns of {{tmath|\mathbf U_2,}} and hence the overall dimensions of <math>\mathbf \Sigma</math> equal to <math>m\times n</math>. Then
<math display=block>
<math display=block>
\begin{bmatrix} \mathbf{U}_1 & \mathbf{U}_2 \end{bmatrix}
\begin{bmatrix} \mathbf{U}_1 & \mathbf{U}_2 \end{bmatrix}
Line 511: Line 469:
= \mathbf{U}_1 \mathbf{D}^\frac{1}{2} \mathbf{V}_1^* = \mathbf{M},
= \mathbf{U}_1 \mathbf{D}^\frac{1}{2} \mathbf{V}_1^* = \mathbf{M},
</math>
</math>
which is the desired result:
which is the desired result:
<math display=block>
<math display=block>
\mathbf{M} = \mathbf{U} \mathbf \Sigma \mathbf{V}^*.
\mathbf{M} = \mathbf{U} \mathbf \Sigma \mathbf{V}^*.
Line 527: Line 483:
Consider the function {{tmath|\sigma}} restricted to {{tmath|S^{m-1} \times S^{n-1}.}} Since both {{tmath|S^{m-1} }} and {{tmath|S^{n-1} }} are [[compact space|compact]] sets, their [[Product topology|product]] is also compact.  Furthermore, since {{tmath|\sigma}} is continuous, it attains a largest value for at least one pair of vectors {{tmath|\mathbf u}} in {{tmath|S^{m-1} }} and {{tmath|\mathbf v}} in {{tmath|S^{n-1}.}} This largest value is denoted {{tmath|\sigma_1}} and the corresponding vectors are denoted {{tmath|\mathbf u_1}} and {{tmath|\mathbf v_1.}} Since {{tmath|\sigma_1}} is the largest value of {{tmath|\sigma(\mathbf u, \mathbf v)}} it must be non-negative. If it were negative, changing the sign of either {{tmath|\mathbf u_1}} or {{tmath|\mathbf v_1}} would make it positive and therefore larger.
Consider the function {{tmath|\sigma}} restricted to {{tmath|S^{m-1} \times S^{n-1}.}} Since both {{tmath|S^{m-1} }} and {{tmath|S^{n-1} }} are [[compact space|compact]] sets, their [[Product topology|product]] is also compact.  Furthermore, since {{tmath|\sigma}} is continuous, it attains a largest value for at least one pair of vectors {{tmath|\mathbf u}} in {{tmath|S^{m-1} }} and {{tmath|\mathbf v}} in {{tmath|S^{n-1}.}} This largest value is denoted {{tmath|\sigma_1}} and the corresponding vectors are denoted {{tmath|\mathbf u_1}} and {{tmath|\mathbf v_1.}} Since {{tmath|\sigma_1}} is the largest value of {{tmath|\sigma(\mathbf u, \mathbf v)}} it must be non-negative. If it were negative, changing the sign of either {{tmath|\mathbf u_1}} or {{tmath|\mathbf v_1}} would make it positive and therefore larger.


'''Statement.''' {{tmath|\mathbf u_1}} and {{tmath|\mathbf v_1}} are left and right-singular vectors of {{tmath|\mathbf M}} with corresponding singular value {{tmath|\sigma_1.}}
{{math theorem |name= Statement |math_statement= {{tmath|\mathbf u_1}} and {{tmath|\mathbf v_1}} are left and right-singular vectors of {{tmath|\mathbf M}} with corresponding singular value {{tmath|\sigma_1.}}
 
}}
'''Proof.''' Similar to the eigenvalues case, by assumption the two vectors satisfy the Lagrange multiplier equation:
{{math proof |title= Proof |proof=
 
Similar to the eigenvalues case, by assumption the two vectors satisfy the Lagrange multiplier equation:
<math display=block>
<math display=block>
\nabla \sigma
\nabla \sigma
Line 539: Line 495:


After some algebra, this becomes
After some algebra, this becomes
<math display=block> \begin{align}
<math display=block> \begin{align}
\mathbf{M} \mathbf{v}_1 &= 2 \lambda_1 \mathbf{u}_1 + 0, \\
\mathbf{M} \mathbf{v}_1 &= 2 \lambda_1 \mathbf{u}_1 + 0, \\
Line 546: Line 501:


Multiplying the first equation from left by {{tmath|\mathbf u_1^\textrm{T} }} and the second equation from left by {{tmath|\mathbf v_1^\textrm{T} }} and taking <math> \| \mathbf u \| = \| \mathbf v \| = 1</math> into account gives
Multiplying the first equation from left by {{tmath|\mathbf u_1^\textrm{T} }} and the second equation from left by {{tmath|\mathbf v_1^\textrm{T} }} and taking <math> \| \mathbf u \| = \| \mathbf v \| = 1</math> into account gives
<math display=block>
<math display=block>
\sigma_1 = 2\lambda_1 = 2\lambda_2.
\sigma_1 = 2\lambda_1 = 2\lambda_2.
Line 552: Line 506:


Plugging this into the pair of equations above, we have
Plugging this into the pair of equations above, we have
<math display=block>\begin{align}
<math display=block>\begin{align}
\mathbf{M} \mathbf{v}_1 &= \sigma_1 \mathbf{u}_1, \\
\mathbf{M} \mathbf{v}_1 &= \sigma_1 \mathbf{u}_1, \\
Line 559: Line 512:


This proves the statement.
This proves the statement.
}}


More singular vectors and singular values can be found by maximizing {{tmath|\sigma(\mathbf u, \mathbf v)}} over normalized {{tmath|\mathbf u}} and {{tmath|\mathbf v}} which are orthogonal to {{tmath|\mathbf u_1}} and {{tmath|\mathbf v_1,}} respectively.
More singular vectors and singular values can be found by maximizing {{tmath|\sigma(\mathbf u, \mathbf v)}} over normalized {{tmath|\mathbf u}} and {{tmath|\mathbf v}} which are orthogonal to {{tmath|\mathbf u_1}} and {{tmath|\mathbf v_1,}} respectively.
Line 568: Line 522:
One-sided Jacobi algorithm is an iterative algorithm,<ref>{{cite journal|first1=P.P.M. de|last1=Rijk|title=A one-sided Jacobi algorithm for computing the singular value decomposition on a vector computer|journal=SIAM J. Sci. Stat. Comput.|volume=10|pages=359–371|year=1989|issue=2 |doi=10.1137/0910023 }}</ref>
One-sided Jacobi algorithm is an iterative algorithm,<ref>{{cite journal|first1=P.P.M. de|last1=Rijk|title=A one-sided Jacobi algorithm for computing the singular value decomposition on a vector computer|journal=SIAM J. Sci. Stat. Comput.|volume=10|pages=359–371|year=1989|issue=2 |doi=10.1137/0910023 }}</ref>
where a matrix is iteratively transformed into a matrix with orthogonal columns. The elementary iteration is given as a [[Jacobi rotation]],
where a matrix is iteratively transformed into a matrix with orthogonal columns. The elementary iteration is given as a [[Jacobi rotation]],
<math display=block>
<math display=block>
M\leftarrow MJ(p, q, \theta),
M\leftarrow MJ(p, q, \theta),
</math>
</math>
where the angle <math>\theta</math> of the Jacobi rotation matrix <math>J(p,q,\theta)</math> is chosen such that after the rotation the columns with numbers <math>p</math> and <math>q</math> become orthogonal. The indices <math>(p,q)</math> are swept cyclically, <math>(p=1\dots m,q=p+1\dots m)</math>, where <math>m</math> is the number of columns.
where the angle <math>\theta</math> of the Jacobi rotation matrix <math>J(p,q,\theta)</math> is chosen such that after the rotation the columns with numbers <math>p</math> and <math>q</math> become orthogonal. The indices <math>(p,q)</math> are swept cyclically, <math>(p=1\dots m,q=p+1\dots m)</math>, where <math>m</math> is the number of columns.


Line 579: Line 531:
=== Two-sided Jacobi algorithm ===
=== Two-sided Jacobi algorithm ===
Two-sided Jacobi SVD algorithm—a generalization of the [[Jacobi eigenvalue algorithm]]—is an iterative algorithm where a square matrix is iteratively transformed into a diagonal matrix. If the matrix is not square the [[QR decomposition]] is performed first and then the algorithm is applied to the <math>R</math> matrix. The elementary iteration zeroes a pair of off-diagonal elements by first applying a [[Givens rotation]] to symmetrize the pair of elements and then applying a [[Jacobi transformation]] to zero them,
Two-sided Jacobi SVD algorithm—a generalization of the [[Jacobi eigenvalue algorithm]]—is an iterative algorithm where a square matrix is iteratively transformed into a diagonal matrix. If the matrix is not square the [[QR decomposition]] is performed first and then the algorithm is applied to the <math>R</math> matrix. The elementary iteration zeroes a pair of off-diagonal elements by first applying a [[Givens rotation]] to symmetrize the pair of elements and then applying a [[Jacobi transformation]] to zero them,
<math display=block>
<math display=block>
M \leftarrow J^TGMJ
M \leftarrow J^TGMJ
</math>
</math>
where <math>G</math> is the Givens rotation matrix with the angle chosen such that the given pair of off-diagonal elements become equal after the rotation, and where <math>J</math> is the Jacobi transformation matrix that zeroes these off-diagonal elements. The iterations proceeds exactly as in the Jacobi eigenvalue algorithm: by cyclic sweeps over all off-diagonal elements.
where <math>G</math> is the Givens rotation matrix with the angle chosen such that the given pair of off-diagonal elements become equal after the rotation, and where <math>J</math> is the Jacobi transformation matrix that zeroes these off-diagonal elements. The iterations proceeds exactly as in the Jacobi eigenvalue algorithm: by cyclic sweeps over all off-diagonal elements.


After the algorithm has converged the resulting diagonal matrix contains the singular values.
After the algorithm has converged the resulting diagonal matrix contains the singular values.
The matrices <math>U</math> and <math>V</math> are accumulated as follows:
The matrices <math>U</math> and <math>V</math> are accumulated as follows:
<math>U\leftarrow UG^TJ</math>,
<math display=block>\begin{align}
<math>V\leftarrow VJ</math>.
U &\leftarrow UG^TJ, \\
V &\leftarrow VJ.
\end{align}</math>


=== Numerical approach ===
=== Numerical approach ===
Line 597: Line 549:
* The non-zero singular values of {{tmath|\mathbf M}} (found on the diagonal entries of <math>\mathbf \Sigma</math>) are the square roots of the non-zero [[eigenvalues]] of both {{tmath|\mathbf M^* \mathbf M}} and {{tmath|\mathbf M \mathbf M^*}}.
* The non-zero singular values of {{tmath|\mathbf M}} (found on the diagonal entries of <math>\mathbf \Sigma</math>) are the square roots of the non-zero [[eigenvalues]] of both {{tmath|\mathbf M^* \mathbf M}} and {{tmath|\mathbf M \mathbf M^*}}.


The SVD of a matrix {{tmath|\mathbf M}} is typically computed by a two-step procedure. In the first step, the matrix is reduced to a [[bidiagonal matrix]]. This takes [[big O notation|order]] {{tmath|O(mn^2)}} floating-point operations (flop), assuming that {{tmath|m \geq n.}} The second step is to compute the SVD of the bidiagonal matrix. This step can only be done with an [[iterative method]] (as with [[eigenvalue algorithm]]s). However, in practice it suffices to compute the SVD up to a certain precision, like the [[machine epsilon]]. If this precision is considered constant, then the second step takes {{tmath|O(n)}} iterations, each costing {{tmath|O(n)}} flops. Thus, the first step is more expensive, and the overall cost is {{tmath|O(mn^2)}} flops {{harv|Trefethen|Bau III|1997|loc=Lecture 31}}.
The SVD of a matrix {{tmath|\mathbf M}} is typically computed by a two-step procedure. In the first step, the matrix is reduced to a [[bidiagonal matrix]]. This takes [[big O notation|order]] {{tmath|O(mn^2)}} floating-point operations ({{dfn|flop}}), assuming that {{tmath|m \geq n.}} The second step is to compute the SVD of the bidiagonal matrix. This step can only be done with an [[iterative method]] (as with [[eigenvalue algorithm]]s). However, in practice it suffices to compute the SVD up to a certain precision, like the [[machine epsilon]]. If this precision is considered constant, then the second step takes {{tmath|O(n)}} iterations, each costing {{tmath|O(n)}} flops. Thus, the first step is more expensive, and the overall cost is {{tmath|O(mn^2)}} flops.{{sfnp|Trefethen|Bau|1997|loc=Lecture 31}}


The first step can be done using [[Householder reflection]]s for a cost of  
The first step can be done using [[Householder reflection]]s for a cost of  
{{tmath|4mn^2 - 4n^3/3}} flops, assuming that only the singular values are needed and not the singular vectors. If {{tmath|m}} is much larger than {{tmath|n}} then it is advantageous to first reduce the matrix {{tmath|\mathbf M}} to a triangular matrix with the [[QR decomposition]] and then use Householder reflections to further reduce the matrix to bidiagonal form; the combined cost is {{tmath|2mn^2 + 2n^3}} flops {{harv|Trefethen|Bau III|1997|loc=Lecture 31}}.
{{tmath|4mn^2 - 4n^3/3}} flops, assuming that only the singular values are needed and not the singular vectors. If {{tmath|m}} is much larger than {{tmath|n}} then it is advantageous to first reduce the matrix {{tmath|\mathbf M}} to a triangular matrix with the [[QR decomposition]] and then use Householder reflections to further reduce the matrix to bidiagonal form; the combined cost is {{tmath|2mn^2 + 2n^3}} flops.{{sfnp|Trefethen|Bau|1997|loc=Lecture 31}}


The second step can be done by a variant of the [[QR algorithm]] for the computation of eigenvalues, which was first described by {{harvtxt|Golub|Kahan|1965}}. The [[LAPACK]] subroutine DBDSQR<ref>[http://www.netlib.org/lapack/double/dbdsqr.f Netlib.org]</ref> implements this iterative method, with some modifications to cover the case where the singular values are very small {{harv|Demmel|Kahan|1990}}. Together with a first step using Householder reflections and, if appropriate, QR decomposition, this forms the DGESVD<ref>[http://www.netlib.org/lapack/double/dgesvd.f Netlib.org]</ref> routine for the computation of the singular value decomposition.
The second step can be done by a variant of the [[QR algorithm]] for the computation of eigenvalues, which was first described by Golub and Kahan in 1965.{{sfnp|Golub|Kahan|1965}} The [[LAPACK]] subroutine {{code|DBDSQR}}{{sfnp|Anderson et al.|1999|loc=[http://www.netlib.org/lapack/double/dbdsqr.f 'DBDSQR' source]}} implements this iterative method, with some modifications to cover the case where the singular values are very small.{{sfnp|Demmel|Kahan|1990}} Together with a first step using Householder reflections and, if appropriate, QR decomposition, this forms the {{code|DGESVD}} routine{{sfnp|Anderson et al.|1999|loc=[http://www.netlib.org/lapack/double/dgesvd.f 'DGESVD' source]}} for the computation of the singular value decomposition.


The same algorithm is implemented in the [[GNU Scientific Library]] (GSL). The GSL also offers an alternative method that uses a one-sided [[Jacobi orthogonalization]] in step 2 {{harv|GSL Team|2007}}. This method computes the SVD of the bidiagonal matrix by solving a sequence of {{tmath|2 \times 2}} SVD problems, similar to how the [[Jacobi eigenvalue algorithm]] solves a sequence of {{tmath|2 \times 2}} eigenvalue methods {{harv|Golub|Van Loan|1996|loc=§8.6.3}}. Yet another method for step 2 uses the idea of [[divide-and-conquer eigenvalue algorithm]]s {{harv|Trefethen|Bau III|1997|loc=Lecture 31}}.
The same algorithm is implemented in the [[GNU Scientific Library]] (GSL). The GSL also offers an alternative method that uses a one-sided [[Jacobi orthogonalization]] in step 2.{{sfnp|GSL Team|2007}} This method computes the SVD of the bidiagonal matrix by solving a sequence of {{tmath|2 \times 2}} SVD problems, similar to how the [[Jacobi eigenvalue algorithm]] solves a sequence of {{tmath|2 \times 2}} eigenvalue methods.{{sfnp|Golub|Van Loan|1996|loc=§8.6.3}} Yet another method for step 2 uses the idea of [[divide-and-conquer eigenvalue algorithm]]s.{{sfnp|Trefethen|Bau|1997|loc=Lecture 31}}


There is an alternative way that does not explicitly use the eigenvalue decomposition.<ref>[http://www.mathworks.co.kr/matlabcentral/fileexchange/12674-simple-svd mathworks.co.kr/matlabcentral/fileexchange/12674-simple-svd]</ref> Usually the singular value problem of a matrix {{tmath|\mathbf M}} is converted into an equivalent symmetric eigenvalue problem such as {{tmath|\mathbf M \mathbf M^*,}} {{tmath|\mathbf M^* \mathbf M,}} or  
There is an alternative way that does not explicitly use the eigenvalue decomposition.<ref>[http://www.mathworks.co.kr/matlabcentral/fileexchange/12674-simple-svd mathworks.co.kr/matlabcentral/fileexchange/12674-simple-svd]</ref> Usually the singular value problem of a matrix {{tmath|\mathbf M}} is converted into an equivalent symmetric eigenvalue problem such as {{tmath|\mathbf M \mathbf M^*,}} {{tmath|\mathbf M^* \mathbf M,}} or  
Line 700: Line 652:
In applications that require an approximation to the [[Moore–Penrose inverse]] of the matrix {{tmath|\mathbf M,}} the smallest singular values of {{tmath|\mathbf M}} are of interest, which are more challenging to compute compared to the largest ones.
In applications that require an approximation to the [[Moore–Penrose inverse]] of the matrix {{tmath|\mathbf M,}} the smallest singular values of {{tmath|\mathbf M}} are of interest, which are more challenging to compute compared to the largest ones.


Truncated SVD is employed in [[latent semantic indexing]].<ref>{{cite journal | last1 = Chicco | first1 = D | last2 = Masseroli | first2 = M | year = 2015 | title = Software suite for gene and protein annotation prediction and similarity search | journal = IEEE/ACM Transactions on Computational Biology and Bioinformatics | volume = 12 | issue = 4 | pages = 837–843 | doi=10.1109/TCBB.2014.2382127 | pmid = 26357324 | hdl = 11311/959408 | s2cid = 14714823 | url = https://doi.org/10.1109/TCBB.2014.2382127 | hdl-access = free }}
Truncated SVD is employed in [[latent semantic indexing]].<ref>{{cite journal | last1 = Chicco | first1 = D | last2 = Masseroli | first2 = M | year = 2015 | title = Software suite for gene and protein annotation prediction and similarity search | journal = IEEE/ACM Transactions on Computational Biology and Bioinformatics | volume = 12 | issue = 4 | pages = 837–843 | doi=10.1109/TCBB.2014.2382127 | pmid = 26357324 | bibcode = 2015ITCBB..12..837C | hdl = 11311/959408 | s2cid = 14714823 | hdl-access = free }}
</ref>
</ref>


Line 754: Line 706:
The singular values of a matrix {{tmath|\mathbf A}} are uniquely defined and are invariant with respect to left and/or right unitary transformations of  {{tmath|\mathbf A.}} In other words, the singular values of {{tmath|\mathbf U \mathbf A \mathbf V,}} for unitary matrices {{tmath|\mathbf U}} and {{tmath|\mathbf V,}} are equal to the singular values of {{tmath|\mathbf A.}} This is an important property for applications in which it is necessary to preserve Euclidean distances and invariance with respect to rotations.
The singular values of a matrix {{tmath|\mathbf A}} are uniquely defined and are invariant with respect to left and/or right unitary transformations of  {{tmath|\mathbf A.}} In other words, the singular values of {{tmath|\mathbf U \mathbf A \mathbf V,}} for unitary matrices {{tmath|\mathbf U}} and {{tmath|\mathbf V,}} are equal to the singular values of {{tmath|\mathbf A.}} This is an important property for applications in which it is necessary to preserve Euclidean distances and invariance with respect to rotations.


The Scale-Invariant SVD, or SI-SVD,<ref>{{citation|last=Uhlmann |first=Jeffrey |author-link=Jeffrey Uhlmann |title=A Generalized Matrix Inverse that is Consistent with Respect to Diagonal Transformations |series=SIAM Journal on Matrix Analysis |year=2018 |volume=239 |issue=2 |pages=781–800 |url=http://faculty.missouri.edu/uhlmannj/UC-SIMAX-Final.pdf |url-status=dead |archive-url=https://web.archive.org/web/20190617095052id_/http://faculty.missouri.edu/uhlmannj/UC-SIMAX-Final.pdf |archive-date= 2019-06-17}}</ref> is analogous to the conventional SVD except that its uniquely-determined singular values are invariant with respect to diagonal transformations of {{tmath|\mathbf A.}} In other words, the singular values of {{tmath|\mathbf D \mathbf A \mathbf E,}} for invertible diagonal matrices {{tmath|\mathbf D}} and {{tmath|\mathbf E,}} are equal to the singular values of {{tmath|\mathbf A.}} This is an important property for applications for which invariance to the choice of units on variables (e.g., metric versus imperial units) is needed.
The Scale-Invariant SVD, or SI-SVD,<ref>{{citation|last=Uhlmann |first=Jeffrey |author-link=Jeffrey Uhlmann |title=A Generalized Matrix Inverse that is Consistent with Respect to Diagonal Transformations |series=SIAM Journal on Matrix Analysis |year=2018 |volume=239 |issue=2 |pages=781–800 |url=http://faculty.missouri.edu/uhlmannj/UC-SIMAX-Final.pdf |archive-url=https://web.archive.org/web/20190617095052id_/http://faculty.missouri.edu/uhlmannj/UC-SIMAX-Final.pdf |archive-date= 2019-06-17}}</ref> is analogous to the conventional SVD except that its uniquely-determined singular values are invariant with respect to diagonal transformations of {{tmath|\mathbf A.}} In other words, the singular values of {{tmath|\mathbf D \mathbf A \mathbf E,}} for invertible diagonal matrices {{tmath|\mathbf D}} and {{tmath|\mathbf E,}} are equal to the singular values of {{tmath|\mathbf A.}} This is an important property for applications for which invariance to the choice of units on variables (e.g., metric versus imperial units) is needed.


=== Bounded operators on Hilbert spaces ===
=== Bounded operators on Hilbert spaces ===
Line 788: Line 740:
</math>
</math>


where the series converges in the norm topology on {{tmath|H.}} Notice how this resembles the expression from the finite-dimensional case. {{tmath|\sigma_i}} are called the singular values of {{tmath|\mathbf M.}} {{tmath|\{\mathbf U e_i\} }} (resp. {{tmath|\{\mathbf U e_i\} }}) can be considered the left-singular (resp. right-singular) vectors of {{tmath|\mathbf M.}}
where the series converges in the norm topology on {{tmath|H.}} Notice how this resembles the expression from the finite-dimensional case. {{tmath|\sigma_i}} are called the singular values of {{tmath|\mathbf M.}} {{tmath|\{\mathbf U e_i\} }} (resp. {{tmath|\{\mathbf V e_i\} }}) can be considered the left-singular (resp. right-singular) vectors of {{tmath|\mathbf M.}}


Compact operators on a Hilbert space are the closure of [[finite-rank operator]]s in the uniform operator topology. The above series expression gives an explicit such representation. An immediate consequence of this is:
Compact operators on a Hilbert space are the closure of [[finite-rank operator]]s in the uniform operator topology. The above series expression gives an explicit such representation. An immediate consequence of this is:
Line 805: Line 757:
  |year=1958 |volume=6 |issue=1 |pages=51–90
  |year=1958 |volume=6 |issue=1 |pages=51–90
  |doi=10.1137/0106005 |mr=0092215 | jstor = 2098862
  |doi=10.1137/0106005 |mr=0092215 | jstor = 2098862
  }}</ref> resembling closely the [[Jacobi eigenvalue algorithm]], which uses plane rotations or [[Givens rotation]]s. However, these were replaced by the method of [[Gene H. Golub|Gene Golub]] and [[William Kahan]] published in 1965,<ref>{{harv|Golub|Kahan|1965}}</ref> which uses [[Householder transformation]]s or reflections. In 1970, Golub and [[Christian Reinsch]]<ref>{{Cite journal
  }}</ref> resembling closely the [[Jacobi eigenvalue algorithm]], which uses plane rotations or [[Givens rotation]]s. However, these were replaced by the method of [[Gene H. Golub|Gene Golub]] and [[William Kahan]] published in 1965,{{sfnp|Golub|Kahan|1965}} which uses [[Householder transformation]]s or reflections. In 1970, Golub and [[Christian Reinsch]] published a variant of the Golub/Kahan algorithm{{sfnp|Golub|Reinsch|1970}} that is still the one most-used today.
|title=Singular value decomposition and least squares solutions
|first1=G. H. |last1=Golub |author-link1=Gene H. Golub
|first2=C. |last2=Reinsch|author2-link=Christian Reinsch  
|year=1970
|journal=Numerische Mathematik
|volume=14 |issue=5 |pages=403–420
|doi=10.1007/BF02163027 |mr=1553974
|s2cid=123532178
}}</ref> published a variant of the Golub/Kahan algorithm that is still the one most-used today.


==See also==
==See also==
Line 853: Line 796:


==Notes==
==Notes==
{{notelist}}
==Footnotes==
{{Reflist}}
{{Reflist}}


==References==
==References==
* {{Citation | last1 = Banerjee | first1 = Sudipto | last2 = Roy | first2 = Anindya | date = 2014 | title = Linear Algebra and Matrix Analysis for Statistics | series = Texts in Statistical Science | publisher = Chapman and Hall/CRC | edition = 1st | isbn = 978-1420095388}}
{{refbegin|30em|indent=yes}}
* {{cite web |last1= Anderson |first1= E. |last2= Bai |first2= Z. |last3= Bischof |first3= C. |last4= Blackford |first4= S. |last5= Demmel |first5= J. |last6= Dongarra |first6= J. |last7= Du Croz |first7= J. |last8= Greenbaum |first8= A. |last9= Hammarling |first9= S. |last10= McKenney |first10= A. |last11= Sorensen |first11= D. |date= 1999 |title= LAPACK Users' Guide |edition= Third |publisher= [[Society for Industrial and Applied Mathematics]] |location= Philadelphia |via= Netlib.org |url= https://www.netlib.org/lapack/lug/ |ref= {{sfnRef|Anderson et al.|1999}} }}
* {{cite book |last1= Banerjee |first1= Sudipto |last2= Roy |first2= Anindya |date= 2014 |title= Linear Algebra and Matrix Analysis for Statistics |series= Texts in Statistical Science |publisher= Chapman and Hall/CRC |edition= 1st |isbn= 978-1-4200-9538-8}}
* {{Cite book | last1=Bisgard | first1 = James | year = 2021 | title = Analysis and Linear Algebra: The Singular Value Decomposition and Applications | series = Student Mathematical Library | publisher = AMS | edition = 1st | isbn = 978-1-4704-6332-8}}
* {{Cite book | last1=Bisgard | first1 = James | year = 2021 | title = Analysis and Linear Algebra: The Singular Value Decomposition and Applications | series = Student Mathematical Library | publisher = AMS | edition = 1st | isbn = 978-1-4704-6332-8}}
* {{cite journal | last1 = Chicco | first1 = D | last2 = Masseroli | first2 = M | year = 2015 | title = Software suite for gene and protein annotation prediction and similarity search | journal = IEEE/ACM Transactions on Computational Biology and Bioinformatics | volume = 12 | issue = 4 | pages = 837–843 | doi=10.1109/TCBB.2014.2382127 | pmid = 26357324 | hdl = 11311/959408 | s2cid = 14714823 | url = https://doi.org/10.1109/TCBB.2014.2382127 | hdl-access = free }}
* {{cite journal | last1 = Chicco | first1 = D | last2 = Masseroli | first2 = M | year = 2015 | title = Software suite for gene and protein annotation prediction and similarity search | journal = IEEE/ACM Transactions on Computational Biology and Bioinformatics | volume = 12 | issue = 4 | pages = 837–843 | doi=10.1109/TCBB.2014.2382127 | pmid = 26357324 | bibcode = 2015ITCBB..12..837C | hdl = 11311/959408 | s2cid = 14714823 | hdl-access = free }}
* {{Cite book | last2=Bau III | first2=David | last1=Trefethen | first1=Lloyd N. | author1-link = Lloyd N. Trefethen | title=Numerical linear algebra | publisher=Society for Industrial and Applied Mathematics | location=Philadelphia | isbn=978-0-89871-361-9 | year=1997 }}
* {{cite journal | last1=Demmel | first1=James | author1-link = James Demmel | last2=Kahan | first2=William | author2-link=William Kahan | title=Accurate singular values of bidiagonal matrices | doi=10.1137/0911052 | year=1990 | journal= SIAM Journal on Scientific and Statistical Computing| volume=11 | issue=5 | pages=873–912 | citeseerx=10.1.1.48.3740 }}
* {{Cite journal | last1=Demmel | first1=James | author1-link = James Demmel | last2=Kahan | first2=William | author2-link=William Kahan | title=Accurate singular values of bidiagonal matrices | doi=10.1137/0911052 | year=1990 | journal= SIAM Journal on Scientific and Statistical Computing| volume=11 | issue=5 | pages=873–912 | citeseerx=10.1.1.48.3740 }}
* {{cite journal |last1= Golub |first1= Gene H. |last2= Kahan |first2= William |date= 1965 |title= Calculating the singular values and pseudo-inverse of a matrix |jstor= 2949777 |journal= Journal of the Society for Industrial and Applied Mathematics, Series B: Numerical Analysis |volume= 2 |issue= 2 |pages= 205–224 |doi= 10.1137/0702016 |bibcode= 1965SJNA....2..205G |author1-link= Gene H. Golub |author2-link= William Kahan }}
* {{Cite journal | last1=Golub | first1=Gene H. | author1-link=Gene H. Golub | last2=Kahan | first2=William | author2-link=William Kahan | title=Calculating the singular values and pseudo-inverse of a matrix | jstor=2949777 | year=1965 | journal=Journal of the Society for Industrial and Applied Mathematics, Series B: Numerical Analysis | volume=2 | issue=2 | pages=205–224 | doi=10.1137/0702016 | bibcode=1965SJNA....2..205G }}
* {{Cite journal |last1= Golub  |first1= G. H. |last2= Reinsch |first2= C. |date= 1970 |title=Singular value decomposition and least squares solutions|journal= Numerische Mathematik |volume= 14 |issue= 5 |pages= 403–420 |doi= 10.1007/BF02163027 |mr= 1553974 |s2cid= 123532178 |author-link1= Gene H. Golub |author2-link= Christian Reinsch }}
* {{Cite book | last1=Golub | first1=Gene H. | author1-link=Gene H. Golub | last2=Van Loan | first2=Charles F. | author2-link=Charles F. Van Loan | title=Matrix Computations | publisher=Johns Hopkins | edition=3rd | isbn=978-0-8018-5414-9 | year=1996 }}
* {{cite book |last1= Golub |first1= Gene H. |author1-link= Gene H. Golub |last2= Van Loan |first2= Charles F. |author2-link= Charles F. Van Loan |date=1996 |title= Matrix Computations |publisher= Johns Hopkins |edition= 3rd |isbn= 978-0-8018-5414-9 }}
* {{Cite book | last1=GSL Team | title=GNU Scientific Library. Reference Manual | year=2007 | chapter=§14.4 Singular Value Decomposition | chapter-url=https://www.gnu.org/software/gsl/manual/html_node/Singular-Value-Decomposition.html }}
* {{cite book | last1=GSL Team | title=GNU Scientific Library. Reference Manual | year=2007 | chapter=§14.4 Singular Value Decomposition | chapter-url=https://www.gnu.org/software/gsl/manual/html_node/Singular-Value-Decomposition.html }}
* Halldor, Bjornsson and Venegas, Silvia A. (1997). [http://brunnur.vedur.is/pub/halldor/TEXT/eofsvd.html "A manual for EOF and SVD analyses of climate data"]. McGill University, CCGCR Report No. 97-1, Montréal, Québec, 52pp.
* {{cite report |last1= Halldor |first1= Bjornsson |last2= Venegas |first2= Silvia A. |date= 1997 |title= A manual for EOF and SVD analyses of climate data |publisher= McGill University |id= CCGCR Report No. 97-1 |location= Montréal, Québec |url= http://brunnur.vedur.is/pub/halldor/TEXT/eofsvd.html }}
* {{Cite journal | doi = 10.1007/BF01937276 | last1 = Hansen | first1 = P. C. | year = 1987 | title = The truncated SVD as a method for regularization | journal = BIT | volume = 27 | issue = 4 | pages = 534–553 | s2cid = 37591557 }}
* {{cite journal |last= Hansen |first= P. C. |date= 1987 |title= The truncated SVD as a method for regularization |journal= BIT |volume= 27 |issue= 4 |pages= 534–553 |s2cid= 37591557 |doi= 10.1007/BF01937276 }}
*{{cite book |author1=Horn, Roger A. |author2=Johnson, Charles R. |title=Matrix Analysis |publisher=Cambridge University Press |year=1985 |isbn=978-0-521-38632-6 |chapter=Section 7.3 }}
* {{cite book |last1= Hastie |first1= Trevor |last2= Tibshirani |first2= Robert |last3= Friedman |first3= Jerome |date= 2009 |title= The Elements of Statistical Learning |edition= 2nd |publisher= Springer |location= New York |pages= 535–536 |isbn= 978-0-387-84857-0}}
*{{cite book |author1=Horn, Roger A. |author2=Johnson, Charles R. |title=Topics in Matrix Analysis |chapter-url=https://archive.org/details/topicsinmatrixan0000horn |chapter-url-access=registration |publisher=Cambridge University Press |year=1991 |isbn=978-0-521-46713-1 |chapter=Chapter 3 }}
* {{cite book |last1= Horn |first1= Roger A. |last2= Johnson |first2= Charles R. |date= 1985 |title= Matrix Analysis |publisher= Cambridge University Press |isbn= 978-0-521-38632-6 |chapter= Section 7.3 }}
*{{cite book |author=Samet, H. |title=Foundations of Multidimensional and Metric Data Structures |publisher=Morgan Kaufmann |year=2006 |isbn=978-0-12-369446-1 |url-access=registration |url=https://archive.org/details/foundationsofmul00same }}
* {{cite book |last1= Horn |first1= Roger A. |last2= Johnson |first2= Charles R. |date= 1991 |title= Topics in Matrix Analysis |chapter= Chapter 3 |publisher= Cambridge University Press |isbn= 978-0-521-46713-1 |chapter-url= https://archive.org/details/topicsinmatrixan0000horn |chapter-url-access= registration }}
*{{cite book |author=Strang G. |title=Introduction to Linear Algebra |publisher=Wellesley-Cambridge Press |year=1998 |isbn=978-0-9614088-5-5 |edition=3rd |chapter=Section 6.7 }}
* {{cite book |last1= Press |first1= W. H. |last2= Teukolsky |first2= S. A. |last3= Vetterling |first3= W. T. |last4= Flannery |first4= B. P. |date= 2007 |title= Numerical Recipes: The Art of Scientific Computing |edition= 3rd |publisher= Cambridge University Press |location= New York |isbn= 978-0-521-88068-8 |chapter= Section 2.6 |chapter-url= http://apps.nrbook.com/empanel/index.html?pg=65}}
* {{Cite journal | last1=Stewart | first1=G. W. | title=On the Early History of the Singular Value Decomposition | url=https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.23.1831 | doi=10.1137/1035134 | jstor=2132388|year=1993 | journal=SIAM Review | volume=35 | issue=4 | pages=551–566 | citeseerx=10.1.1.23.1831 | hdl=1903/566 }}
* {{cite book |last= Samet |first= H. |date= 2006 |title= Foundations of Multidimensional and Metric Data Structures |publisher= Morgan Kaufmann |isbn= 978-0-12-369446-1 |url-access= registration |url= https://archive.org/details/foundationsofmul00same }}
*{{cite book |last1=Wall|first1 = Michael E.|first2 = Andreas|last2 = Rechtsteiner|first3 = Luis M.|last3 = Rocha | author3-link = Luis M. Rocha | chapter=Singular value decomposition and principal component analysis |chapter-url=http://public.lanl.gov/mewall/kluwer2002.html |editor1=D.P. Berrar |editor2=W. Dubitzky |editor3=M. Granzow |title=A Practical Approach to Microarray Data Analysis |publisher=Kluwer |location=Norwell, MA |year=2003 |pages=91–109 }}
* {{cite book |last= Strang |first= G. |date= 1998 |title= Introduction to Linear Algebra |edition= 3rd |chapter= Section 6.7 |publisher= Wellesley-Cambridge Press |isbn= 978-0-9614088-5-5 }}
*{{Citation|last1=Press|first1=WH|last2=Teukolsky|first2=SA|last3=Vetterling|first3=WT|last4=Flannery|first4=BP|year=2007|title=Numerical Recipes: The Art of Scientific Computing|edition=3rd|publisher=Cambridge University Press| location=New York|isbn=978-0-521-88068-8|chapter=Section 2.6|chapter-url=http://apps.nrbook.com/empanel/index.html?pg=65}}
* {{cite journal |last1= Stewart |first1= G. W. |date= 1993 |title= On the Early History of the Singular Value Decomposition |journal= SIAM Review |volume= 35 |issue= 4 |pages= 551–566 |doi= 10.1137/1035134 |jstor= 2132388 |citeseerx= 10.1.1.23.1831 |hdl= 1903/566 }}
* {{cite book |last1= Trefethen | first1= Lloyd N. |last2= Bau |first2= David III |date= 1997 |title= Numerical Linear Algebra |publisher= Society for Industrial and Applied Mathematics |location= Philadelphia |isbn= 978-0-89871-361-9 |author1-link= Lloyd N. Trefethen }}
* {{cite book |last1= Wall |first1= Michael E. |last2= Rechtsteiner |first2= Andreas |last3= Rocha |first3= Luis M. |date= 2003 | chapter= Singular value decomposition and principal component analysis |editor1-last= Berrar |editor1-first= D. P. |editor2-last= Dubitzky |editor2-first= W. |editor3-last= Granzow |editor3-first= M. |title= A Practical Approach to Microarray Data Analysis |publisher= Kluwer |location= Norwell, Massachusetts |pages= 91–109 |author3-link= Luis M. Rocha |chapter-url= http://public.lanl.gov/mewall/kluwer2002.html }}
{{refend}}h


== External links ==
== External links ==

Latest revision as of 07:54, 10 November 2025

Template:Short description Template:Use dmy dates Template:CS1 config

File:Singular-Value-Decomposition.svg
Illustration of the singular value decomposition Template:Math of a real Template:Math matrix Template:Math.Template:Ubli

In linear algebra, the singular value decomposition (SVD) is a factorization of a real or complex matrix into a rotation, followed by a rescaling followed by another rotation. It generalizes the eigendecomposition of a square normal matrix with an orthonormal eigenbasis to any Template:Tmath matrix. It is related to the polar decomposition.

Specifically, the singular value decomposition of an m×n complex matrix Template:Tmath is a factorization of the form 𝐌=𝐔Σ𝐕*, where Template:Tmath is an Template:Tmath complex unitary matrix, Σ is an m×n rectangular diagonal matrix with non-negative real numbers on the diagonal, Template:Tmath is an n×n complex unitary matrix, and 𝐕* is the conjugate transpose of Template:Tmath. Such decomposition always exists for any complex matrix. If Template:Tmath is real, then Template:Tmath and Template:Tmath can be guaranteed to be real orthogonal matrices; in such contexts, the SVD is often denoted 𝐔Σ𝐕T.

The diagonal entries σi=Σii of Σ are uniquely determined by Template:Tmath and are known as the singular values of Template:Tmath. The number of non-zero singular values is equal to the rank of Template:Tmath. The columns of Template:Tmath and the columns of Template:Tmath are called left-singular vectors and right-singular vectors of Template:Tmath, respectively. They form two sets of orthonormal bases Template:Tmath and Template:Tmath and if they are sorted so that the singular values σi with value zero are all in the highest-numbered columns (or rows), the singular value decomposition can be written as 𝐌=i=1rσi𝐮i𝐯i*, where rmin{m,n} is the rank of Template:Tmath

The SVD is not unique. However, it is always possible to choose the decomposition such that the singular values Σii are in descending order. In this case, Σ (but not Template:Tmath and Template:Tmath) is uniquely determined by Template:Tmath

The term sometimes refers to the compact SVD, a similar decomposition Template:Tmath in which Template:Tmath is square diagonal of size Template:Tmath where Template:Tmath is the rank of Template:Tmath and has only the non-zero singular values. In this variant, Template:Tmath is an Template:Tmath semi-unitary matrix and 𝐕 is an Template:Tmath semi-unitary matrix, such that 𝐔*𝐔=𝐕*𝐕=𝐈r.

Mathematical applications of the SVD include computing the pseudoinverse, matrix approximation, and determining the rank, range, and null space of a matrix. The SVD is also extremely useful in many areas of science, engineering, and statistics, such as signal processing, least squares fitting of data, and process control.

Intuitive interpretations

File:Singular value decomposition.gif
Animated illustration of the SVD of a 2D, real shearing matrix Template:Math. First, we see the unit disc in blue together with the two canonical unit vectors. We then see the actions of Template:Math, which distorts the disk to an ellipse. The SVD decomposes Template:Math into three simple transformations: an initial rotation Template:Math, a scaling Σ along the coordinate axes, and a final rotation Template:Math. The lengths Template:Math and Template:Math of the semi-axes of the ellipse are the singular values of Template:Math, namely Template:Math and Template:Math.
File:Singular value decomposition visualisation.svg
Visualization of the matrix multiplications in singular value decomposition

Rotation, coordinate scaling, and reflection

In the special case when Template:Tmath is an Template:Tmath real square matrix, the matrices Template:Tmath and Template:Tmath can be chosen to be real Template:Tmath matrices too. In that case, "unitary" is the same as "orthogonal". Then, interpreting both unitary matrices as well as the diagonal matrix, summarized here as Template:Tmath as a linear transformation Template:Tmath of the space Template:Tmath the matrices Template:Tmath and Template:Tmath represent rotations or reflection of the space, while Template:Tmath represents the scaling of each coordinate Template:Tmath by the factor Template:Tmath Thus the SVD decomposition breaks down any linear transformation of Template:Tmath into a composition of three geometrical transformations: a rotation or reflection Template:Nobr followed by a coordinate-by-coordinate scaling Template:Nobr followed by another rotation or reflection Template:Nobr

In particular, if Template:Tmath has a positive determinant, then Template:Tmath and Template:Tmath can be chosen to be both rotations with reflections, or both rotations without reflections.Script error: No such module "Unsubst". If the determinant is negative, exactly one of them will have a reflection. If the determinant is zero, each can be independently chosen to be of either type.

If the matrix Template:Tmath is real but not square, namely Template:Tmath with Template:Tmath it can be interpreted as a linear transformation from Template:Tmath to Template:Tmath Then Template:Tmath and Template:Tmath can be chosen to be rotations/reflections of Template:Tmath and Template:Tmath respectively; and Template:Tmath besides scaling the first Template:Tmath coordinates, also extends the vector with zeros, i.e. removes trailing coordinates, so as to turn Template:Tmath into Template:Tmath

Singular values as semiaxes of an ellipse or ellipsoid

As shown in the figure, the singular values can be interpreted as the magnitude of the semiaxes of an ellipse in 2D. This concept can be generalized to Template:Tmath-dimensional Euclidean space, with the singular values of any Template:Tmath square matrix being viewed as the magnitude of the semiaxis of an Template:Tmath-dimensional ellipsoid. Similarly, the singular values of any Template:Tmath matrix can be viewed as the magnitude of the semiaxis of an Template:Tmath-dimensional ellipsoid in Template:Tmath-dimensional space, for example as an ellipse in a (tilted) 2D plane in a 3D space. Singular values encode magnitude of the semiaxis, while singular vectors encode direction. See below for further details.

The columns of Template:Math and Template:Math are orthonormal bases

Since Template:Tmath and Template:Tmath are unitary, the columns of each of them form a set of orthonormal vectors, which can be regarded as basis vectors. The matrix Template:Tmath maps the basis vector Template:Tmath to the stretched unit vector Template:Tmath By the definition of a unitary matrix, the same is true for their conjugate transposes Template:Tmath and Template:Tmath except the geometric interpretation of the singular values as stretches is lost. In short, the columns of Template:Tmath Template:Tmath Template:Tmath and Template:Tmath are orthonormal bases. When Template:Tmath is a positive-semidefinite Hermitian matrix, Template:Tmath and Template:Tmath are both equal to the unitary matrix used to diagonalize Template:Tmath However, when Template:Tmath is not positive-semidefinite and Hermitian but still diagonalizable, its eigendecomposition and singular value decomposition are distinct.

Relation to the four fundamental subspaces

Geometric meaning

Because Template:Tmath and Template:Tmath are unitary, we know that the columns Template:Tmath of Template:Tmath yield an orthonormal basis of Template:Tmath and the columns Template:Tmath of Template:Tmath yield an orthonormal basis of Template:Tmath (with respect to the standard scalar products on these spaces).

The linear transformation T:{KnKmx𝐌x has a particularly simple description with respect to these orthonormal bases: we have T(𝐕i)=σi𝐔i,i=1,,min(m,n), where Template:Tmath is the Template:Tmath-th diagonal entry of Template:Tmath and Template:Tmath for Template:Tmath

The geometric content of the SVD theorem can thus be summarized as follows: for every linear map Template:Tmath one can find orthonormal bases of Template:Tmath and Template:Tmath such that Template:Tmath maps the Template:Tmath-th basis vector of Template:Tmath to a non-negative multiple of the Template:Tmath-th basis vector of Template:Tmath and sends the leftover basis vectors to zero. With respect to these bases, the map Template:Tmath is therefore represented by a diagonal matrix with non-negative real diagonal entries.

To get a more visual flavor of singular values and SVD factorization – at least when working on real vector spaces – consider the sphere Template:Tmath of radius one in Template:Tmath The linear map Template:Tmath maps this sphere onto an ellipsoid in Template:Tmath Non-zero singular values are simply the lengths of the semi-axes of this ellipsoid. Especially when Template:Tmath and all the singular values are distinct and non-zero, the SVD of the linear map Template:Tmath can be easily analyzed as a succession of three consecutive moves: consider the ellipsoid Template:Tmath and specifically its axes; then consider the directions in Template:Tmath sent by Template:Tmath onto these axes. These directions happen to be mutually orthogonal. Apply first an isometry Template:Tmath sending these directions to the coordinate axes of Template:Tmath On a second move, apply an endomorphism Template:Tmath diagonalized along the coordinate axes and stretching or shrinking in each direction, using the semi-axes lengths of Template:Tmath as stretching coefficients. The composition Template:Tmath then sends the unit-sphere onto an ellipsoid isometric to Template:Tmath To define the third and last move, apply an isometry Template:Tmath to this ellipsoid to obtain Template:Tmath As can be easily checked, the composition Template:Tmath coincides with Template:Tmath

Example

Consider the Template:Tmath matrix 𝐌=[10002003000000002000]

A singular value decomposition of this matrix is given by Template:Tmath

𝐔=[0100100000010010]Σ=[300000500000200000𝟎0]𝐕*=[001000.20000.801000000100.80000.2]

The scaling matrix Template:Tmath is zero outside of the diagonal (grey italics) and one diagonal element is zero (red bold, light blue bold in dark mode). Furthermore, because the matrices Template:Tmath and Template:Tmath are unitary, multiplying by their respective conjugate transposes yields identity matrices, as shown below. In this case, because Template:Tmath and Template:Tmath are real valued, each is an orthogonal matrix.

𝐔𝐔*=[1000010000100001]=𝐈4𝐕𝐕*=[1000001000001000001000001]=𝐈5

This particular singular value decomposition is not unique. For instance, we can keep Template:Tmath and Template:Tmath the same, but change the last two rows of Template:Tmath such that 𝐕*=[001000.20000.8010000.4000.50.10.4000.50.1]

and get an equally valid singular value decomposition. As the matrix Template:Tmath has rank 3, it has only 3 nonzero singular values. In taking the product Template:Tmath, the final column of Template:Tmath and the final two rows of Template:Tmath are multiplied by zero, so have no effect on the matrix product, and can be replaced by any unit vectors which are orthogonal to the first three and to each-other.

The compact SVD, Template:Tmath, eliminates these superfluous rows, columns, and singular values: 𝐔r=[010100000001]Σr=[300050002]𝐕r*=[001000.20000.801000]

SVD and spectral decomposition

Singular values, singular vectors, and their relation to the SVD

A non-negative real number Template:Tmath is a singular value for Template:Tmath if and only if there exist unit vectors Template:Tmath in Template:Tmath and Template:Tmath in Template:Tmath such that 𝐌𝐯=σ𝐮,𝐌*𝐮=σ𝐯.

The vectors Template:Tmath and Template:Tmath are called left-singular and right-singular vectors for Template:Tmath respectively.

In any singular value decomposition 𝐌=𝐔Σ𝐕* the diagonal entries of Template:Tmath are equal to the singular values of Template:Tmath The first Template:Tmath columns of Template:Tmath and Template:Tmath are, respectively, left- and right-singular vectors for the corresponding singular values. Consequently, the above theorem implies that:

A singular value for which we can find two left (or right) singular vectors that are linearly independent is called degenerate. If Template:Tmath and Template:Tmath are two left-singular vectors which both correspond to the singular value σ, then any normalized linear combination of the two vectors is also a left-singular vector corresponding to the singular value σ. The similar statement is true for right-singular vectors. The number of independent left and right-singular vectors coincides, and these singular vectors appear in the same columns of Template:Tmath and Template:Tmath corresponding to diagonal elements of Template:Tmath all with the same value Template:Tmath

As an exception, the left and right-singular vectors of singular value 0 comprise all unit vectors in the cokernel and kernel, respectively, of Template:Tmath which by the rank–nullity theorem cannot be the same dimension if Template:Tmath Even if all singular values are nonzero, if Template:Tmath then the cokernel is nontrivial, in which case Template:Tmath is padded with Template:Tmath orthogonal vectors from the cokernel. Conversely, if Template:Tmath then Template:Tmath is padded by Template:Tmath orthogonal vectors from the kernel. However, if the singular value of Template:Tmath exists, the extra columns of Template:Tmath or Template:Tmath already appear as left or right-singular vectors.

Non-degenerate singular values always have unique left- and right-singular vectors, up to multiplication by a unit-phase factor Template:Tmath (for the real case up to a sign). Consequently, if all singular values of a square matrix Template:Tmath are non-degenerate and non-zero, then its singular value decomposition is unique, up to multiplication of a column of Template:Tmath by a unit-phase factor and simultaneous multiplication of the corresponding column of Template:Tmath by the same unit-phase factor. In general, the SVD is unique up to arbitrary unitary transformations applied uniformly to the column vectors of both Template:Tmath and Template:Tmath spanning the subspaces of each singular value, and up to arbitrary unitary transformations on vectors of Template:Tmath and Template:Tmath spanning the kernel and cokernel, respectively, of Template:Tmath

Relation to eigenvalue decomposition

The singular value decomposition is very general in the sense that it can be applied to any Template:Tmath matrix, whereas eigenvalue decomposition can only be applied to square diagonalizable matrices. Nevertheless, the two decompositions are related.

If Template:Tmath has SVD Template:Tmath the following two relations hold: 𝐌*𝐌=𝐕Σ*𝐔*𝐔Σ𝐕*=𝐕(Σ*Σ)𝐕*,𝐌𝐌*=𝐔Σ𝐕*𝐕Σ*𝐔*=𝐔(ΣΣ*)𝐔*.

The right-hand sides of these relations describe the eigenvalue decompositions of the left-hand sides. Consequently:

In the special case of Template:Tmath being a normal matrix, and thus also square, the spectral theorem ensures that it can be unitarily diagonalized using a basis of eigenvectors, and thus decomposed as Template:Tmath for some unitary matrix Template:Tmath and diagonal matrix Template:Tmath with complex elements Template:Tmath along the diagonal. When Template:Tmath is positive semi-definite, Template:Tmath will be non-negative real numbers so that the decomposition Template:Tmath is also a singular value decomposition. Otherwise, it can be recast as an SVD by moving the phase Template:Tmath of each Template:Tmath to either its corresponding Template:Tmath or Template:Tmath The natural connection of the SVD to non-normal matrices is through the polar decomposition theorem: Template:Tmath where Template:Tmath is positive semidefinite and normal, and Template:Tmath is unitary.

Thus, except for positive semi-definite matrices, the eigenvalue decomposition and SVD of Template:Tmath while related, differ: the eigenvalue decomposition is Template:Tmath where Template:Tmath is not necessarily unitary and Template:Tmath is not necessarily positive semi-definite, while the SVD is Template:Tmath where Template:Tmath is diagonal and positive semi-definite, and Template:Tmath and Template:Tmath are unitary matrices that are not necessarily related except through the matrix Template:Tmath While only non-defective square matrices have an eigenvalue decomposition, any Template:Tmath matrix has a SVD.

Applications of the SVD

Pseudoinverse

The singular value decomposition can be used for computing the pseudoinverse of a matrix. The pseudoinverse of the matrix Template:Tmath with singular value decomposition Template:Tmath is 𝐌+=𝐕Σ+𝐔, where Σ+ is the pseudoinverse of Σ, which is formed by replacing every non-zero diagonal entry by its reciprocal and transposing the resulting matrix. The pseudoinverse is one way to solve linear least squares problems.

Solving homogeneous linear equations

A set of homogeneous linear equations can be written as Template:Tmath for a matrix Template:Tmath, vector Template:Tmath, and zero vector Template:Tmath. A typical situation is that Template:Tmath is known and a non-zero Template:Tmath is to be determined which satisfies the equation. Such an Template:Tmath belongs to Template:Tmath's null space and is sometimes called a (right) null vector of Template:Tmath The vector Template:Tmath can be characterized as a right-singular vector corresponding to a singular value of Template:Tmath that is zero. This observation means that if Template:Tmath is a square matrix and has no vanishing singular value, the equation has no non-zero Template:Tmath as a solution. It also means that if there are several vanishing singular values, any linear combination of the corresponding right-singular vectors is a valid solution. Analogously to the definition of a (right) null vector, a non-zero Template:Tmath satisfying Template:Tmath with Template:Tmath denoting the conjugate transpose of Template:Tmath is called a left null vector of Template:Tmath

Total least squares minimization

A total least squares problem seeks the vector Template:Tmath that minimizes the 2-norm of a vector Template:Tmath under the constraint 𝐱=1. The solution turns out to be the right-singular vector of Template:Tmath corresponding to the smallest singular value.

Range, null space and rank

Another application of the SVD is that it provides an explicit representation of the range and null space of a matrix Template:Tmath The right-singular vectors corresponding to vanishing singular values of Template:Tmath span the null space of Template:Tmath and the left-singular vectors corresponding to the non-zero singular values of Template:Tmath span the range of Template:Tmath For example, in the above example the null space is spanned by the last row of Template:Tmath and the range is spanned by the first three columns of Template:Tmath

As a consequence, the rank of Template:Tmath equals the number of non-zero singular values which is the same as the number of non-zero diagonal elements in Σ. In numerical linear algebra the singular values can be used to determine the effective rank of a matrix, as rounding error may lead to small but non-zero singular values in a rank deficient matrix. Singular values beyond a significant gap are assumed to be numerically equivalent to zero.

Low-rank matrix approximation

Some practical applications need to solve the problem of approximating a matrix Template:Tmath with another matrix 𝐌~, said to be truncated, which has a specific rank Template:Tmath. In the case that the approximation is based on minimizing the Frobenius norm of the difference between Template:Tmath and Template:Tmath under the constraint that rank(𝐌~)=r, it turns out that the solution is given by the SVD of Template:Tmath namely 𝐌~=𝐔Σ~𝐕*, where Σ~ is the same matrix as Σ except that it contains only the Template:Tmath largest singular values (the other singular values are replaced by zero). This is known as the Eckart–Young theorem, as it was proved by those two authors in 1936.Template:Efn

Image compression

File:Svd compression.jpg
Singular-value decomposition (SVD) image compression of a 1996 Chevrolet Corvette photograph. The original RGB image (upper-left) is compared with rank 1, 10, and 100 reconstructions.

One practical consequence of the low-rank approximation given by SVD is that a greyscale image represented as an

m×n

matrix

𝐀

, can be efficiently represented by keeping the first

k

singular values and corresponding vectors. The truncated decomposition

𝐀k=j=1kσj𝐮j𝐯jT gives an image with the best 2-norm error out of all rank k approximations. Thus, the task becomes finding an approximation that balances retaining perceptual fidelity with the number of vectors required to reconstruct the image. Storing 𝐀k requires only k(n+m+1) floating-point numbers compared to nm integers. This same idea extends to color images by applying this operation to each channel or stacking the channels into one matrix.

Since the singular values of most natural images decay quickly, most of their variance is often captured by a small k. For a 1528 × 1225 greyscale image, we can achieve a relative error of .7% with as little as k=100.[1] In practice, however, computing the SVD can be too computationally expensive and the resulting compression is typically less storage efficient than a specialized algorithm such as JPEG.

Separable models

The SVD can be thought of as decomposing a matrix into a weighted, ordered sum of separable matrices. By separable, we mean that a matrix Template:Tmath can be written as an outer product of two vectors Template:Tmath or, in coordinates, Template:Tmath Specifically, the matrix Template:Tmath can be decomposed as,

𝐌=i𝐀i=iσi𝐔i𝐕i.

Here Template:Tmath and Template:Tmath are the Template:Tmath-th columns of the corresponding SVD matrices, Template:Tmath are the ordered singular values, and each Template:Tmath is separable. The SVD can be used to find the decomposition of an image processing filter into separable horizontal and vertical filters. Note that the number of non-zero Template:Tmath is exactly the rank of the matrix.Script error: No such module "Unsubst". Separable models often arise in biological systems, and the SVD factorization is useful to analyze such systems. For example, some visual area V1 simple cells' receptive fields can be well described[2] by a Gabor filter in the space domain multiplied by a modulation function in the time domain. Thus, given a linear filter evaluated through, for example, reverse correlation, one can rearrange the two spatial dimensions into one dimension, thus yielding a two-dimensional filter (space, time) which can be decomposed through SVD. The first column of Template:Tmath in the SVD factorization is then a Gabor while the first column of Template:Tmath represents the time modulation (or vice versa). One may then define an index of separability

α=σ12iσi2,

which is the fraction of the power in the matrix M which is accounted for by the first separable matrix in the decomposition.[3]

Nearest orthogonal matrix

It is possible to use the SVD of a square matrix Template:Tmath to determine the orthogonal matrix Template:Tmath closest to Template:Tmath The closeness of fit is measured by the Frobenius norm of Template:Tmath The solution is the product Template:Tmath[4]Template:Sfnp This intuitively makes sense because an orthogonal matrix would have the decomposition Template:Tmath where Template:Tmath is the identity matrix, so that if Template:Tmath then the product Template:Tmath amounts to replacing the singular values with ones. Equivalently, the solution is the unitary matrix Template:Tmath of the Polar Decomposition 𝐌=𝐑𝐏=𝐏𝐑 in either order of stretch and rotation, as described above.

A similar problem, with interesting applications in shape analysis, is the orthogonal Procrustes problem, which consists of finding an orthogonal matrix Template:Tmath which most closely maps Template:Tmath to Template:Tmath Specifically, 𝐐=argminΩ𝐀Ω𝐁Fsubject toΩTΩ=𝐈, where F denotes the Frobenius norm.

This problem is equivalent to finding the nearest orthogonal matrix to a given matrix 𝐌=𝐀T𝐁.

The Kabsch algorithm

The Kabsch algorithm (called Wahba's problem in other fields) uses SVD to compute the optimal rotation (with respect to least-squares minimization) that will align a set of points with a corresponding set of points. It is used, among other applications, to compare the structures of molecules.

Principal Component Analysis

The SVD can be used to construct the principal components in principal component analysis as follows:Template:Sfnp

Let 𝐗N×p be a data matrix where each of the N rows is a (feature-wise) mean-centered observation, each of dimension p.

The SVD of 𝐗 is: 𝐗=𝐕Σ𝐔

We see that 𝐕Σ contains the scores of the rows of 𝐗 (i.e. each observation), and 𝐔 is the matrix whose columns are principal component loading vectors.Template:Sfnp

Signal processing

The SVD and pseudoinverse have been successfully applied to signal processing,[5] image processing[6] and big data (e.g., in genomic signal processing).[7][8][9][10]

Other examples

The SVD is also applied extensively to the study of linear inverse problems and is useful in the analysis of regularization methods such as that of Tikhonov. It is widely used in statistics, where it is related to principal component analysis and to correspondence analysis, and in signal processing and pattern recognition. It is also used in output-only modal analysis, where the non-scaled mode shapes can be determined from the singular vectors. Yet another usage is latent semantic indexing in natural-language text processing.

In general numerical computation involving linear or linearized systems, there is a universal constant that characterizes the regularity or singularity of a problem, which is the system's "condition number" κ:=σmax/σmin. It often controls the error rate or convergence rate of a given computational scheme on such systems.[11][12]

The SVD also plays a crucial role in the field of quantum information, in a form often referred to as the Schmidt decomposition. Through it, states of two quantum systems are naturally decomposed, providing a necessary and sufficient condition for them to be entangled: if the rank of the Σ matrix is larger than one.

One application of SVD to rather large matrices is in numerical weather prediction, where Lanczos methods are used to estimate the most linearly quickly growing few perturbations to the central numerical weather prediction over a given initial forward time period; i.e., the singular vectors corresponding to the largest singular values of the linearized propagator for the global weather over that time interval. The output singular vectors in this case are entire weather systems. These perturbations are then run through the full nonlinear model to generate an ensemble forecast, giving a handle on some of the uncertainty that should be allowed for around the current central prediction.

SVD has also been applied to reduced order modelling. The aim of reduced order modelling is to reduce the number of degrees of freedom in a complex system which is to be modeled. SVD was coupled with radial basis functions to interpolate solutions to three-dimensional unsteady flow problems.[13]

Interestingly, SVD has been used to improve gravitational waveform modeling by the ground-based gravitational-wave interferometer aLIGO.[14] SVD can help to increase the accuracy and speed of waveform generation to support gravitational-waves searches and update two different waveform models.

Singular value decomposition is used in recommender systems to predict people's item ratings.[15] Distributed algorithms have been developed for the purpose of calculating the SVD on clusters of commodity machines.[16]

Low-rank SVD has been applied for hotspot detection from spatiotemporal data with application to disease outbreak detection.[17] A combination of SVD and higher-order SVD also has been applied for real time event detection from complex data streams (multivariate data with space and time dimensions) in disease surveillance.[18]

In astrodynamics, the SVD and its variants are used as an option to determine suitable maneuver directions for transfer trajectory design[19] and orbital station-keeping.[20]

The SVD can be used to measure the similarity between real-valued matrices.[21] By measuring the angles between the singular vectors, the inherent two-dimensional structure of matrices is accounted for. This method was shown to outperform cosine similarity and Frobenius norm in most cases, including brain activity measurements from neuroscience experiments.

Proof of existence

An eigenvalue Template:Tmath of a matrix Template:Tmath is characterized by the algebraic relation Template:Tmath When Template:Tmath is Hermitian, a variational characterization is also available. Let Template:Tmath be a real Template:Tmath symmetric matrix. Define

f:{n𝐱𝐱T𝐌𝐱

By the extreme value theorem, this continuous function attains a maximum at some Template:Tmath when restricted to the unit sphere {𝐱=1}. By the Lagrange multipliers theorem, Template:Tmath necessarily satisfies 𝐮T𝐌𝐮λ𝐮T𝐮=𝟎 for some real number Template:Tmath The nabla symbol, Template:Tmath, is the del operator (differentiation with respect to Template:Nobr Using the symmetry of Template:Tmath we obtain 𝐱T𝐌𝐱λ𝐱T𝐱=2(𝐌λ𝐈)𝐱.

Therefore Template:Tmath so Template:Tmath is a unit length eigenvector of Template:Tmath For every unit length eigenvector Template:Tmath of Template:Tmath its eigenvalue is Template:Tmath so Template:Tmath is the largest eigenvalue of Template:Tmath The same calculation performed on the orthogonal complement of Template:Tmath gives the next largest eigenvalue and so on. The complex Hermitian case is similar; there Template:Tmath is a real-valued function of Template:Tmath real variables.

Singular values are similar in that they can be described algebraically or from variational principles. Although, unlike the eigenvalue case, Hermiticity, or symmetry, of Template:Tmath is no longer required.

This section gives these two arguments for existence of singular value decomposition.

Based on the spectral theorem

Let 𝐌 be an Template:Tmath complex matrix. Since 𝐌*𝐌 is positive semi-definite and Hermitian, by the spectral theorem, there exists an Template:Tmath unitary matrix 𝐕 such that 𝐕*𝐌*𝐌𝐕=𝐃¯=[𝐃000], where 𝐃 is diagonal and positive definite, of dimension ×, with the number of non-zero eigenvalues of 𝐌*𝐌 (which can be shown to verify min(n,m)). Note that 𝐕 is here by definition a matrix whose i-th column is the i-th eigenvector of 𝐌*𝐌, corresponding to the eigenvalue 𝐃¯ii. Moreover, the j-th column of 𝐕, for j>, is an eigenvector of 𝐌*𝐌 with eigenvalue 𝐃¯jj=0. This can be expressed by writing 𝐕 as 𝐕=[𝐕1𝐕2], where the columns of 𝐕1 and 𝐕2 therefore contain the eigenvectors of 𝐌*𝐌 corresponding to non-zero and zero eigenvalues, respectively. Using this rewriting of 𝐕, the equation becomes: [𝐕1*𝐕2*]𝐌*𝐌[𝐕1𝐕2]=[𝐕1*𝐌*𝐌𝐕1𝐕1*𝐌*𝐌𝐕2𝐕2*𝐌*𝐌𝐕1𝐕2*𝐌*𝐌𝐕2]=[𝐃000].

This implies that 𝐕1*𝐌*𝐌𝐕1=𝐃,𝐕2*𝐌*𝐌𝐕2=𝟎.

Moreover, the second equation implies 𝐌𝐕2=𝟎.Template:Efn Finally, the unitary-ness of 𝐕 translates, in terms of 𝐕1 and 𝐕2, into the following conditions: 𝐕1*𝐕1=𝐈1,𝐕2*𝐕2=𝐈2,𝐕1𝐕1*+𝐕2𝐕2*=𝐈12, where the subscripts on the identity matrices are used to remark that they are of different dimensions.

Let us now define 𝐔1=𝐌𝐕1𝐃12.

Then, 𝐔1𝐃12𝐕1*=𝐌𝐕1𝐃12𝐃12𝐕1*=𝐌(𝐈𝐕2𝐕2*)=𝐌(𝐌𝐕2)𝐕2*=𝐌,

since 𝐌𝐕2=𝟎. This can be also seen as immediate consequence of the fact that 𝐌𝐕1𝐕1*=𝐌. This is equivalent to the observation that if {vi}i=1 is the set of eigenvectors of 𝐌*𝐌 corresponding to non-vanishing eigenvalues {λi}i=1, then {𝐌vi}i=1 is a set of orthogonal vectors, and {λi1/2𝐌vi}|i=1 is a (generally not complete) set of orthonormal vectors. This matches with the matrix formalism used above denoting with 𝐕1 the matrix whose columns are {vi}i=1, with 𝐕2 the matrix whose columns are the eigenvectors of 𝐌*𝐌 with vanishing eigenvalue, and 𝐔1 the matrix whose columns are the vectors {λi1/2𝐌vi}|i=1.

We see that this is almost the desired result, except that 𝐔1 and 𝐕1 are in general not unitary, since they might not be square. However, we do know that the number of rows of 𝐔1 is no smaller than the number of columns, since the dimensions of 𝐃 is no greater than m and n. Also, since 𝐔1*𝐔1=𝐃12𝐕1*𝐌*𝐌𝐕1𝐃12=𝐃12𝐃𝐃12=I𝟏, the columns in 𝐔1 are orthonormal and can be extended to an orthonormal basis. This means that we can choose 𝐔2 such that 𝐔=[𝐔1𝐔2] is unitary.

For Template:Tmath we already have Template:Tmath to make it unitary. Now, define Σ=[[𝐃12000]0],

where extra zero rows are added or removed to make the number of zero rows equal the number of columns of Template:Tmath and hence the overall dimensions of Σ equal to m×n. Then [𝐔1𝐔2][[D12000]0][𝐕1𝐕2]*=[𝐔1𝐔2][𝐃12𝐕1*0]=𝐔1𝐃12𝐕1*=𝐌, which is the desired result: 𝐌=𝐔Σ𝐕*.

Notice the argument could begin with diagonalizing Template:Tmath rather than Template:Tmath (This shows directly that Template:Tmath and Template:Tmath have the same non-zero eigenvalues).

Based on variational characterization

Script error: No such module "anchor".The singular values can also be characterized as the maxima of Template:Tmath considered as a function of Template:Tmath and Template:Tmath over particular subspaces. The singular vectors are the values of Template:Tmath and Template:Tmath where these maxima are attained.

Let Template:Tmath denote an Template:Tmath matrix with real entries. Let Template:Tmath be the unit (k1)-sphere in k, and define σ(𝐮,𝐯)=𝐮T𝐌𝐯, 𝐮Sm1, 𝐯Sn1.

Consider the function Template:Tmath restricted to Template:Tmath Since both Template:Tmath and Template:Tmath are compact sets, their product is also compact. Furthermore, since Template:Tmath is continuous, it attains a largest value for at least one pair of vectors Template:Tmath in Template:Tmath and Template:Tmath in Template:Tmath This largest value is denoted Template:Tmath and the corresponding vectors are denoted Template:Tmath and Template:Tmath Since Template:Tmath is the largest value of Template:Tmath it must be non-negative. If it were negative, changing the sign of either Template:Tmath or Template:Tmath would make it positive and therefore larger.

Template:Math theorem Template:Math proof

More singular vectors and singular values can be found by maximizing Template:Tmath over normalized Template:Tmath and Template:Tmath which are orthogonal to Template:Tmath and Template:Tmath respectively.

The passage from real to complex is similar to the eigenvalue case.

Calculating the SVD

One-sided Jacobi algorithm

One-sided Jacobi algorithm is an iterative algorithm,[22] where a matrix is iteratively transformed into a matrix with orthogonal columns. The elementary iteration is given as a Jacobi rotation, MMJ(p,q,θ), where the angle θ of the Jacobi rotation matrix J(p,q,θ) is chosen such that after the rotation the columns with numbers p and q become orthogonal. The indices (p,q) are swept cyclically, (p=1m,q=p+1m), where m is the number of columns.

After the algorithm has converged, the singular value decomposition M=USVT is recovered as follows: the matrix V is the accumulation of Jacobi rotation matrices, the matrix U is given by normalising the columns of the transformed matrix M, and the singular values are given as the norms of the columns of the transformed matrix M.

Two-sided Jacobi algorithm

Two-sided Jacobi SVD algorithm—a generalization of the Jacobi eigenvalue algorithm—is an iterative algorithm where a square matrix is iteratively transformed into a diagonal matrix. If the matrix is not square the QR decomposition is performed first and then the algorithm is applied to the R matrix. The elementary iteration zeroes a pair of off-diagonal elements by first applying a Givens rotation to symmetrize the pair of elements and then applying a Jacobi transformation to zero them, MJTGMJ where G is the Givens rotation matrix with the angle chosen such that the given pair of off-diagonal elements become equal after the rotation, and where J is the Jacobi transformation matrix that zeroes these off-diagonal elements. The iterations proceeds exactly as in the Jacobi eigenvalue algorithm: by cyclic sweeps over all off-diagonal elements.

After the algorithm has converged the resulting diagonal matrix contains the singular values. The matrices U and V are accumulated as follows: UUGTJ,VVJ.

Numerical approach

The singular value decomposition can be computed using the following observations:

The SVD of a matrix Template:Tmath is typically computed by a two-step procedure. In the first step, the matrix is reduced to a bidiagonal matrix. This takes order Template:Tmath floating-point operations (Template:Dfn), assuming that Template:Tmath The second step is to compute the SVD of the bidiagonal matrix. This step can only be done with an iterative method (as with eigenvalue algorithms). However, in practice it suffices to compute the SVD up to a certain precision, like the machine epsilon. If this precision is considered constant, then the second step takes Template:Tmath iterations, each costing Template:Tmath flops. Thus, the first step is more expensive, and the overall cost is Template:Tmath flops.Template:Sfnp

The first step can be done using Householder reflections for a cost of Template:Tmath flops, assuming that only the singular values are needed and not the singular vectors. If Template:Tmath is much larger than Template:Tmath then it is advantageous to first reduce the matrix Template:Tmath to a triangular matrix with the QR decomposition and then use Householder reflections to further reduce the matrix to bidiagonal form; the combined cost is Template:Tmath flops.Template:Sfnp

The second step can be done by a variant of the QR algorithm for the computation of eigenvalues, which was first described by Golub and Kahan in 1965.Template:Sfnp The LAPACK subroutine DBDSQRTemplate:Sfnp implements this iterative method, with some modifications to cover the case where the singular values are very small.Template:Sfnp Together with a first step using Householder reflections and, if appropriate, QR decomposition, this forms the DGESVD routineTemplate:Sfnp for the computation of the singular value decomposition.

The same algorithm is implemented in the GNU Scientific Library (GSL). The GSL also offers an alternative method that uses a one-sided Jacobi orthogonalization in step 2.Template:Sfnp This method computes the SVD of the bidiagonal matrix by solving a sequence of Template:Tmath SVD problems, similar to how the Jacobi eigenvalue algorithm solves a sequence of Template:Tmath eigenvalue methods.Template:Sfnp Yet another method for step 2 uses the idea of divide-and-conquer eigenvalue algorithms.Template:Sfnp

There is an alternative way that does not explicitly use the eigenvalue decomposition.[23] Usually the singular value problem of a matrix Template:Tmath is converted into an equivalent symmetric eigenvalue problem such as Template:Tmath Template:Tmath or

[𝟎𝐌𝐌*𝟎].

The approaches that use eigenvalue decompositions are based on the QR algorithm, which is well-developed to be stable and fast. Note that the singular values are real and right- and left- singular vectors are not required to form similarity transformations. One can iteratively alternate between the QR decomposition and the LQ decomposition to find the real diagonal Hermitian matrices. The QR decomposition gives Template:Tmath and the LQ decomposition of Template:Tmath gives Template:Tmath Thus, at every iteration, we have Template:Tmath update Template:Tmath and repeat the orthogonalizations. Eventually,Template:Clarify this iteration between QR decomposition and LQ decomposition produces left- and right- unitary singular matrices. This approach cannot readily be accelerated, as the QR algorithm can with spectral shifts or deflation. This is because the shift method is not easily defined without using similarity transformations. However, this iterative approach is very simple to implement, so is a good choice when speed does not matter. This method also provides insight into how purely orthogonal/unitary transformations can obtain the SVD.

Analytic result of 2 × 2 SVD

The singular values of a Template:Tmath matrix can be found analytically. Let the matrix be 𝐌=z0𝐈+z1σ1+z2σ2+z3σ3

where zi are complex numbers that parameterize the matrix, Template:Tmath is the identity matrix, and σi denote the Pauli matrices. Then its two singular values are given by

σ±=|z0|2+|z1|2+|z2|2+|z3|2±(|z0|2+|z1|2+|z2|2+|z3|2)2|z02z12z22z32|2=|z0|2+|z1|2+|z2|2+|z3|2±2(Rez0z1*)2+(Rez0z2*)2+(Rez0z3*)2+(Imz1z2*)2+(Imz2z3*)2+(Imz3z1*)2

Reduced SVDs

File:Reduced Singular Value Decompositions.svg
Visualization of Reduced SVD variants. From top to bottom: 1: Full SVD, 2: Thin SVD (remove columns of Template:Math not corresponding to rows of Template:Math), 3: Compact SVD (remove vanishing singular values and corresponding columns/rows in Template:Math and Template:Math), 4: Truncated SVD (keep only largest t singular values and corresponding columns/rows in Template:Math and Template:Math)

In applications it is quite unusual for the full SVD, including a full unitary decomposition of the null-space of the matrix, to be required. Instead, it is often sufficient (as well as faster, and more economical for storage) to compute a reduced version of the SVD. The following can be distinguished for an Template:Tmath matrix Template:Tmath of rank Template:Tmath:

Thin SVD

The thin, or economy-sized, SVD of a matrix Template:Tmath is given by[24]

𝐌=𝐔kΣk𝐕k*,

where k=min(m,n), the matrices Template:Tmath and Template:Tmath contain only the first Template:Tmath columns of Template:Tmath and Template:Tmath and Template:Tmath contains only the first Template:Tmath singular values from Template:Tmath The matrix Template:Tmath is thus Template:Tmath Template:Tmath is Template:Tmath diagonal, and Template:Tmath is Template:Tmath

The thin SVD uses significantly less space and computation time if Template:Tmath The first stage in its calculation will usually be a QR decomposition of Template:Tmath which can make for a significantly quicker calculation in this case.

Compact SVD

The compact SVD of a matrix Template:Tmath is given by

𝐌=𝐔rΣr𝐕r*.

Only the Template:Tmath column vectors of Template:Tmath and Template:Tmath row vectors of Template:Tmath corresponding to the non-zero singular values Template:Tmath are calculated. The remaining vectors of Template:Tmath and Template:Tmath are not calculated. This is quicker and more economical than the thin SVD if Template:Tmath The matrix Template:Tmath is thus Template:Tmath Template:Tmath is Template:Tmath diagonal, and Template:Tmath is Template:Tmath

Truncated SVD

In many applications the number Template:Tmath of the non-zero singular values is large making even the Compact SVD impractical to compute. In such cases, the smallest singular values may need to be truncated to compute only Template:Tmath non-zero singular values. The truncated SVD is no longer an exact decomposition of the original matrix Template:Tmath but rather provides the optimal low-rank matrix approximation Template:Tmath by any matrix of a fixed rank Template:Tmath

𝐌~=𝐔tΣt𝐕t*,

where matrix Template:Tmath is Template:Tmath Template:Tmath is Template:Tmath diagonal, and Template:Tmath is Template:Tmath Only the Template:Tmath column vectors of Template:Tmath and Template:Tmath row vectors of Template:Tmath corresponding to the Template:Tmath largest singular values Template:Tmath are calculated. This can be much quicker and more economical than the compact SVD if Template:Tmath but requires a completely different toolset of numerical solvers.

In applications that require an approximation to the Moore–Penrose inverse of the matrix Template:Tmath the smallest singular values of Template:Tmath are of interest, which are more challenging to compute compared to the largest ones.

Truncated SVD is employed in latent semantic indexing.[25]

Norms

Ky Fan norms

The sum of the Template:Tmath largest singular values of Template:Tmath is a matrix norm, the Ky Fan Template:Tmath-norm of Template:Tmath[26]

The first of the Ky Fan norms, the Ky Fan 1-norm, is the same as the operator norm of Template:Tmath as a linear operator with respect to the Euclidean norms of Template:Tmath and Template:Tmath In other words, the Ky Fan 1-norm is the operator norm induced by the standard 2 Euclidean inner product. For this reason, it is also called the operator 2-norm. One can easily verify the relationship between the Ky Fan 1-norm and singular values. It is true in general, for a bounded operator Template:Tmath on (possibly infinite-dimensional) Hilbert spaces

𝐌=𝐌*𝐌12

But, in the matrix case, Template:Tmath is a normal matrix, so 𝐌*𝐌1/2 is the largest eigenvalue of Template:Tmath i.e. the largest singular value of Template:Tmath

The last of the Ky Fan norms, the sum of all singular values, is the trace norm (also known as the 'nuclear norm'), defined by 𝐌=Tr(𝐌*𝐌)1/2 (the eigenvalues of Template:Tmath are the squares of the singular values).

Hilbert–Schmidt normScript error: No such module "anchor".

The singular values are related to another norm on the space of operators. Consider the Hilbert–Schmidt inner product on the Template:Tmath matrices, defined by

𝐌,𝐍=tr(𝐍*𝐌).

So the induced norm is

𝐌=𝐌,𝐌=tr(𝐌*𝐌).

Since the trace is invariant under unitary equivalence, this shows

𝐌=|iσi2

where Template:Tmath are the singular values of Template:Tmath This is called the Frobenius norm, Schatten 2-norm, or Hilbert–Schmidt norm of Template:Tmath Direct calculation shows that the Frobenius norm of Template:Tmath coincides with:

|ij|mij|2.

In addition, the Frobenius norm and the trace norm (the nuclear norm) are special cases of the Schatten norm.

Variations and generalizations

Scale-invariant SVD

The singular values of a matrix Template:Tmath are uniquely defined and are invariant with respect to left and/or right unitary transformations of Template:Tmath In other words, the singular values of Template:Tmath for unitary matrices Template:Tmath and Template:Tmath are equal to the singular values of Template:Tmath This is an important property for applications in which it is necessary to preserve Euclidean distances and invariance with respect to rotations.

The Scale-Invariant SVD, or SI-SVD,[27] is analogous to the conventional SVD except that its uniquely-determined singular values are invariant with respect to diagonal transformations of Template:Tmath In other words, the singular values of Template:Tmath for invertible diagonal matrices Template:Tmath and Template:Tmath are equal to the singular values of Template:Tmath This is an important property for applications for which invariance to the choice of units on variables (e.g., metric versus imperial units) is needed.

Bounded operators on Hilbert spaces

The factorization Template:Tmath can be extended to a bounded operator Template:Tmath on a separable Hilbert space Template:Tmath Namely, for any bounded operator Template:Tmath there exist a partial isometry Template:Tmath a unitary Template:Tmath a measure space Template:Tmath and a non-negative measurable Template:Tmath such that

𝐌=𝐔Tf𝐕*

where Template:Tmath is the [[multiplication operator|multiplication by Template:Tmath]] on Template:Tmath

This can be shown by mimicking the linear algebraic argument for the matrix case above. Template:Tmath is the unique positive square root of Template:Tmath as given by the Borel functional calculus for self-adjoint operators. The reason why Template:Tmath need not be unitary is that, unlike the finite-dimensional case, given an isometry Template:Tmath with nontrivial kernel, a suitable Template:Tmath may not be found such that

[U1U2]

is a unitary operator.

As for matrices, the singular value factorization is equivalent to the polar decomposition for operators: we can simply write

𝐌=𝐔𝐕*𝐕Tf𝐕*

and notice that Template:Tmath is still a partial isometry while Template:Tmath is positive.

Singular values and compact operators

The notion of singular values and left/right-singular vectors can be extended to compact operator on Hilbert space as they have a discrete spectrum. If Template:Tmath is compact, every non-zero Template:Tmath in its spectrum is an eigenvalue. Furthermore, a compact self-adjoint operator can be diagonalized by its eigenvectors. If Template:Tmath is compact, so is Template:Tmath. Applying the diagonalization result, the unitary image of its positive square root Template:Tmath has a set of orthonormal eigenvectors Template:Tmath corresponding to strictly positive eigenvalues Template:Tmath. For any Template:Tmath in Template:Tmath

𝐌ψ=𝐔Tf𝐕*ψ=i𝐔Tf𝐕*ψ,𝐔ei𝐔ei=iσiψ,𝐕ei𝐔ei,

where the series converges in the norm topology on Template:Tmath Notice how this resembles the expression from the finite-dimensional case. Template:Tmath are called the singular values of Template:Tmath Template:Tmath (resp. Template:Tmath) can be considered the left-singular (resp. right-singular) vectors of Template:Tmath

Compact operators on a Hilbert space are the closure of finite-rank operators in the uniform operator topology. The above series expression gives an explicit such representation. An immediate consequence of this is:

Theorem. Template:Tmath is compact if and only if Template:Tmath is compact.

History

The singular value decomposition was originally developed by differential geometers, who wished to determine whether a real bilinear form could be made equal to another by independent orthogonal transformations of the two spaces it acts on. Eugenio Beltrami and Camille Jordan discovered independently, in 1873 and 1874 respectively, that the singular values of the bilinear forms, represented as a matrix, form a complete set of invariants for bilinear forms under orthogonal substitutions. James Joseph Sylvester also arrived at the singular value decomposition for real square matrices in 1889, apparently independently of both Beltrami and Jordan. Sylvester called the singular values the canonical multipliers of the matrix Template:Tmath The fourth mathematician to discover the singular value decomposition independently is Autonne in 1915, who arrived at it via the polar decomposition. The first proof of the singular value decomposition for rectangular and complex matrices seems to be by Carl Eckart and Gale J. Young in 1936;[28] they saw it as a generalization of the principal axis transformation for Hermitian matrices.

In 1907, Erhard Schmidt defined an analog of singular values for integral operators (which are compact, under some weak technical assumptions); it seems he was unaware of the parallel work on singular values of finite matrices. This theory was further developed by Émile Picard in 1910, who is the first to call the numbers σk singular values (or in French, valeurs singulières).

Practical methods for computing the SVD date back to Kogbetliantz in 1954–1955 and Hestenes in 1958,[29] resembling closely the Jacobi eigenvalue algorithm, which uses plane rotations or Givens rotations. However, these were replaced by the method of Gene Golub and William Kahan published in 1965,Template:Sfnp which uses Householder transformations or reflections. In 1970, Golub and Christian Reinsch published a variant of the Golub/Kahan algorithmTemplate:Sfnp that is still the one most-used today.

See also

Template:Columns-list

Notes

Template:Notelist

Footnotes

Template:Reflist

References

Template:Refbegin

  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "Citation/CS1".
  • Script error: No such module "Citation/CS1".
  • Script error: No such module "Citation/CS1".
  • Script error: No such module "Citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Template:Cite report
  • Script error: No such module "Citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "Citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".

Template:Refendh

External links

Template:Numerical linear algebra Template:Functional Analysis Template:SpectralTheory

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "Citation/CS1".
  3. Script error: No such module "Citation/CS1".
  4. The Singular Value Decomposition in Symmetric (Lowdin) Orthogonalization and Data Compression
  5. Script error: No such module "Citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "Citation/CS1".
  8. Script error: No such module "Citation/CS1".
  9. Script error: No such module "Citation/CS1".
  10. Script error: No such module "Citation/CS1".
  11. Script error: No such module "Citation/CS1".
  12. Script error: No such module "Citation/CS1".
  13. Script error: No such module "Citation/CS1".
  14. Script error: No such module "Citation/CS1".
  15. Template:Cite report
  16. Script error: No such module "citation/CS1".
  17. Script error: No such module "Citation/CS1".
  18. Script error: No such module "Citation/CS1".
  19. Script error: No such module "Citation/CS1".
  20. Script error: No such module "Citation/CS1".
  21. Script error: No such module "Citation/CS1".
  22. Script error: No such module "Citation/CS1".
  23. mathworks.co.kr/matlabcentral/fileexchange/12674-simple-svd
  24. Script error: No such module "citation/CS1".
  25. Script error: No such module "Citation/CS1".
  26. Script error: No such module "Citation/CS1".
  27. Script error: No such module "citation/CS1".
  28. Script error: No such module "Citation/CS1".
  29. Script error: No such module "Citation/CS1".