6. Singular Value Decomposition and Statistical Foundations
Central Limit Theorem and Statistical Sampling
The Central Limit Theorem (CLT) dictates that as the sample size or the number of sampling repetitions () increases, the sampling distribution of the sample mean approaches a normal distribution in probability space.
Estimating a population mean without full access to population-wide data is achieved by repeatedly taking small random samples (with potential repetition) and calculating their individual sample means.
Convergence Example:
Target population mean grade for Lab 1 assignment:
First random sample of 5 individuals yields a sample mean grade of
Second random sample yields a sample mean grade of
Third random sample yields a sample mean grade of
As the sampling repetitions () increase, taking the overall average of all calculated sample means (, , , etc.) converges directly toward the true population mean of
Feature Information, Variance, and Covariance
Variance:
Measures the dispersion or variation of a single random variable or feature (a single dataset column) around its mean value.
Represents the dispersion and total information content present within a single feature.
Sample variance formula for a feature with data points:
Covariance:
Compares two random variables or features ( and ) to evaluate how they vary jointly (e.g., whether variable increases or decreases as variable increases).
Note that and denote two dataset features/columns, not independent and dependent variables.
Sample covariance formula between features and across data points:
A higher covariance magnitude indicates that the feature pair interacts or relates on a higher scale.
Covariance Matrix:
A square matrix of dimension , where represents the number of random variables or dataset features.
Each position in the matrix contains the calculated covariance of the feature () and feature ():
Symmetric matrix across the main diagonal, satisfying:
Diagonal entries where represent the individual feature variances:
Singular Value Decomposition (SVD) Principles and Applications
Definition: SVD is a matrix factorization method that decomposes any arbitrary matrix of dimension into simpler constituent matrices, analogous to a chemical decomposition reaction breaking down a compound into simpler elements.
SVD compresses data and extracts feature and sample importance, establishing ranking scales to separate essential features from redundant ones.
Applications:
Principal Component Analysis (PCA): Serves as the structural foundation for dimensionality reduction.
Image Compression: Reduces redundant pixel counts while preserving image content. For example, compressing a square image of pixels down to pixels by removing redundant pixels and retaining high-importance features.
Recommender Systems: Encodes users, products, and objects into lower-dimensional compressed representations to enable fast pairwise comparisons against millions of catalog items (e.g., streaming platforms like Netflix matching user viewing histories to content distributions).
Data Denoising: Reduces feature dimensionality to extract signals and eliminate noise components.
Anatomy and Mathematical Structure of SVD
Factoring an matrix into three product matrices:
Left Singular Matrix ():
Dimension: square matrix.
Describes the sample space, corresponding to the records or rows in the data.
Columns are the left singular vectors u_i$.\n* **Right Singular Matrix (V)**:\n * Dimension: n \times n square matrix.\n * Describes the feature space, corresponding to the n features or columns in the data.\n * Columns are the right singular vectors v_i\Sigma$):
Dimension: or matrix (identical shape to original matrix ).
Diagonal matrix containing singular values arranged along the main diagonal.
Describes the importance, strength, or scale of corresponding sample and feature directions.
Step-by-Step Computational Procedure for SVD
Standard eigenvalue decomposition requires a square matrix. SVD bypasses non-square restrictions for matrix () by computing square covariance matrices () and ().
Step 1: Compute Right Singular Vectors ():
Construct the feature covariance matrix of dimension
Solve the characteristic equation for eigenvalues :
Solve for eigenvectors :
Normalize each eigenvector using its norm: where for vector , the norm is:
Set normalized vectors as columns of matrix . These vectors point in the direction of the data spread along features.
Step 2: Compute Singular Values ():
Compute singular values as square roots of eigenvalues:
Sort singular values in descending order:
Place sorted values on the main diagonal entries of an matrix.
The maximum number of available diagonal positions is bounded by .
Step 3: Compute Left Singular Vectors ():
Use the computational shortcut relating , , , and :
Compute vectors for
Form the matrix
Detailed Mathematical Worked Example
Consider a matrix of dimension ( samples, features):
Dimension of :
Dimension of covariance matrix :
Eigenvalue Calculation of :
Diagonal/element entry evaluation snippet:
Solving the characteristic matrix yields three sorted eigenvalues:
Eigenvector Computation and Normalization:
For , solve to yield eigenvector
Normalize by dividing components by the vector norm:
Repeating for and yields normalized column vectors forming the matrix
Singular Values and Matrix Construction:
Compute singular values:
Construct matrix :
Positions and . The third singular value is redundant/omitted because matrix dimensions allow only diagonal entries.
Left Singular Vectors () Construction:
Matrix requires size (2 column vectors):
is not required because is bounded by vectors.
Matrix Dimension Verification:
:
:
:
:
Multiplying reconstructs the original matrix
Questions and Student Interactions
Question: For a matrix, when computing SVD, would the fourth column of the matrix consist entirely of zeros (i.e., )?
Answer: Yes. For a matrix , the matrix maintains size . Diagonal entries exist only up to index , meaning the fourth column consists entirely of zero entries . The maximum number of singular values usable along the main diagonal is bounded by .