Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Haifengl Smile Decomposition Result Extraction

From Leeroopedia


Overview

Decomposition Result Extraction is the final stage of the Matrix_Decomposition_Pipeline, where the factored components produced by decompositions are accessed, manipulated, and used for downstream analysis. This includes extracting singular values and vectors from SVD, eigenvalues and eigenvectors from EVD, sorting eigenvalues, constructing diagonal matrices, and computing derived quantities such as matrix rank, condition number, null space, and range.

For large sparse matrices where full decomposition is infeasible, Smile provides ARPACK (Implicitly Restarted Arnoldi/Lanczos Method) for computing a small number of extremal eigenpairs or singular triples efficiently.

Theoretical Basis

SVD Result Interpretation

Given the SVD A=UΣVT:

Component Symbol Interpretation
Singular values σ1σ2σk Importance of each component; square roots of eigenvalues of ATA
Left singular vectors U=[u1,u2,,uk] Orthonormal basis for the column space of A
Right singular vectors V=[v1,v2,,vk] Orthonormal basis for the row space of A
Diagonal matrix Σ=diag(σ1,,σk) The "stretching factors" of the transformation

Derived Quantities from SVD

Matrix Rank: The number of singular values above a threshold:

r=#{i:σi>ϵrcond}

where the threshold is ϵrcond=12m+n+1σ1ϵmach.

Condition Number: The ratio of the largest to smallest singular value:

κ(A)=σ1σk

A condition number close to 1 indicates a well-conditioned matrix. When κ(A) is large or infinite, the matrix is ill-conditioned or singular.

Nullity: nullity(A)=min(m,n)r

Range Space: The first r columns of U form an orthonormal basis for range(A).

Null Space: The last nullity rows of VT (equivalently, last columns of V) form an orthonormal basis for null(A).

The Eckart-Young Theorem

The truncated SVD provides the best low-rank matrix approximation. Keeping only the top r singular values:

Ar=i=1rσiuiviT

minimizes AArF and AAr2 over all rank-r matrices. This is the theoretical basis for PCA, latent semantic indexing, and data compression.

EVD Result Interpretation

Given the eigenvalue decomposition of a square matrix A:

Symmetric Case

A=VΛVT

where Λ=diag(λ1,,λn) with all real eigenvalues and V is orthogonal.

Spectral properties:

  • All eigenvalues are real
  • Eigenvectors corresponding to distinct eigenvalues are orthogonal
  • tr(A)=iλi
  • det(A)=iλi
  • Positive definite iff all λi>0

General (Non-Symmetric) Case

Eigenvalues may be complex: λi=wr,i+jwi,i

The diagonal matrix uses a block structure:

  • Real eigenvalue λi: a 1x1 block on the diagonal
  • Complex conjugate pair λi=a+bi: a 2x2 block [abba]

Sorting Eigenvalues

Eigenvalues are sorted by descending magnitude:

|λ1|2|λ2|2|λn|2

where |λi|2=wr,i2+wi,i2. The corresponding eigenvectors are reordered accordingly.

ARPACK: Large Sparse Eigenproblems

For matrices too large for full EVD (O(n3)), ARPACK computes a small number kn of eigenvalues using the Implicitly Restarted Arnoldi Method (IRAM):

For symmetric matrices (Lanczos variant):

  • Builds a Krylov subspace 𝒦k(A,v0)=span{v0,Av0,A2v0,,Ak1v0}
  • Extracts eigenvalue approximations (Ritz values) from the tridiagonal projection
  • Applies implicit QR shifts to restart with a refined subspace

Which eigenvalues to compute (SymmOption enum):

Option Description Use Case
LA Largest algebraic PCA (largest positive eigenvalues)
SA Smallest algebraic Graph Laplacian (near-zero eigenvalues)
LM Largest magnitude Dominant modes, spectral radius
SM Smallest magnitude Near-singular directions
BE Both ends Spectral gap analysis

Computational complexity: O(nkncv) where ncv is the number of Arnoldi vectors (typically 3k), compared to O(n3) for full EVD.

Key property: ARPACK only requires the action of A on a vector (matrix-vector product), not the matrix entries themselves. This enables use with sparse matrices and implicit matrix representations.

ARPACK SVD

ARPACK can also compute the top-k singular triples by solving the equivalent eigenproblem on ATA (via the AtA implicit matrix wrapper) and recovering the singular vectors.

Relationship to the Pipeline

Construction --> Arithmetic --> Decomposition --> Solving --> Result Extraction
                                                                    ^
                                                                    |
                                                             (this principle)

Result extraction is the final stage that produces the quantities used by ML algorithms: eigenvalues for PCA, singular values for matrix rank, eigenvectors for spectral clustering, and so on.

Related

Knowledge Sources

Domains

Linear_Algebra, Numerical_Computing, Dimensionality_Reduction, Spectral_Analysis

Categories

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment