SVD Calculator
The singular value decomposition of matrices will never cause you any problems again — with the help of our SVD calculator, you will quickly master this important topic in linear algebra. Scroll down and learn:
-
What is the singular value decomposition?
-
How do I find the SVD of a matrix using our SVD calculator?
-
How to calculate the SVD of a matrix by hand?
-
Is the singular value decomposition unique?
Ready? Let's go!
What is the singular value decomposition?
Singular value decomposition (SVD) is a way of factorizing a matrix: any real matrix AA of size m×nm×n decomposes as
where UU and VV are orthogonal matrices of sizes m×mm×m and n×nn×n respectively, and ΣΣ is a rectangular matrix of the same size as AA (so m×nm×n) which has non-negative numbers on its diagonal and zeroes everywhere else. The diagonal elements of ΣΣ are in fact the singular values of AA.
🙋 If AA is complex, replace the transposition (we also have matrix transpose calculator to help you with that) VTVT with the complex conjugation V∗V∗. UU and VV then become unitary matrices, but ΣΣ still features real non-negative numbers on its diagonal.
Here's a visualization of singular value decomposition of a 4×34×3 matrix MM.
Once we know what the singular value decomposition of a matrix is, it'd be beneficial to see some examples. Calculating SVD by hand is a time-consuming procedure, as we will see in the section on How to calculate SVD of a matrix. We bet the quickest way to generate examples of SVD is to use singular value decomposition calculator!
How to use this SVD calculator
Working with this SVD calculator is simple!
- Pick the matrix size: the number of rows and the number of columns in AA.
- Enter the matrix entries in their dedicated fields.
- The components of singular value decomposition UU, ΣΣ and VTVT will appear at the bottom of the calculator.
Do you want to verify the results? Just perform the matrix multiplication of the result's three matrices and compare that outcome with your initial matrix. Remember that numerical computations and rounding may cause tiny discrepancies!
Do you want to understand how the SVD calculator got its results? In the next section, we will discuss all the theory that stands behind the singular value decomposition and explain step-by-step how to find the SVD of a matrix. Ready?
How to calculate SVD of a matrix
Here's how to calculate the singular value decomposition of a m×nm×n matrix AA by hand. We will see that SVD is closely related to the eigenvalues and eigenvectors of AA.
As we remember, we can easily find the eigenvalues and eigenvectors for square matrices, yet AA can be rectangular in SVD. What can we do? Let's consider two square matrices that are closely related to AA: these matrices are ATAATA and AATAAT:
- The columns of VV are eigenvectors of ATAATA.
- The non-zero elements of ΣΣ are the non-zero singular values of AA, i.e., they are the square roots of the non-zero eigenvalues of ATAATA.
- Once we know VV and ΣΣ, we can recover UU from the SVD formula (A=UΣVTA=UΣVT).
In more details, to find SVD by hand:
-
Compute ATAATA.
-
Compute the eigenvalues and eigenvectors of ATAATA.
-
Draw a matrix of the same size as AA and fill in its diagonal entries with the square roots of the eigenvalues you found in Step 2. This is ΣΣ.
-
Write down the matrix whose columns are the eigenvectors you found in Step 2. This is VV.
-
The SVD equation A=UΣVTA=UΣVT transforms to AV=UΣAV=UΣ. We can rewrite this in terms of columns as Avi=σiuiAvi=σiui. This tells us how to compute UU, as the columns of UU set ui=σi1Aviui=σi1Avi for every ii such that σi=0σi=0.
-
If UU needs more columns to fill its size, you can pick arbitrary vectors, but you have to make sure that UU is an orthogonal matrix. Therefore, you must pick vectors that have unit length and are orthogonal to all the columns in UU (and the ones you're adding).
Is singular value decomposition unique?
No, the SVD is not unique. Even if we agree to have the diagonal elements of Σ in descending order (which makes Σ unique), the matrices U and V are still non-unique.
FAQs
- Is singular value decomposition unique?
- No, the SVD is not unique. Even if we agree to have the diagonal elements of Σ in descending order (which makes Σ unique), the matrices U and V are still non-unique.
- What does SVD do to a matrix?
- SVD decomposes an arbitrary rectangular matrix A into the product of three matrices UΣVᵀ, which is subject to some constraints. These U and V are orthogonal matrices. Σ has the same size as A and contains the singular values of A as its diagonal entries.
- What is SVD of a symmetric matrix?
- If A is real symmetric, then its singular values (the diagonal elements of Σ) coincide with the absolute values of its eigenvalues. The columns of U and V are the unit eigenvectors of A. In particular, if the eigenvalues of A are all strictly positive (i.e. A is positive definite), then U = V and the SVD of A coincides with the eigendecomposition of A.
- What is SVD of a unitary matrix?
- For unitary matrices, SVD is trivial. Namely, if A is unitary (i.e., AA = AA* = I), then all of the singular values of A are equal to 1. Hence, in SVD we have U = A , Σ = I, and V = I.
Related calculators
Remainder
Use the remainder calculator to find the quotient and remainder of division.
Math
Slope
Calculate the slope of a line from two given points using the slope calculator. Discover the slope formula and learn how to find a slope with two points.
Math
Average
Calculate the average (mean) with our user-friendly tool. Discover how to find averages or perform quick calculations effortlessly.
Math
Circumference
Use this free circumference calculator to find the area, circumference and diameter of a circle.
Math