Randomized SVD
190 words
1 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Randomized SVD ## 2.1 Motivation Computing the full SVD of a large matrix is $O(mn^2)$ — infeasible for big data. Randomized SVD computes a near-optimal low-rank approximation much faster.

Randomized SVD
2.1 Motivation
Computing the full SVD of a large matrix is O(mn2) — infeasible for big data. Randomized SVD computes a near-optimal low-rank approximation much faster.
2.2 Algorithm
- Draw random projection matrix Ω∈Rn×(k+p)
- Compute Y=AΩ
- Compute QR factorization: Y=QR
- Project: B=QTA
- Compute SVD of small matrix B=UBΣBVBT
- Result: A≈(QUB)ΣBVBT
Python Implementation
pythonimport numpy as np def randomized_svd(A, k, p=5): n, m = A.shape Omega = np.random.randn(m, k + p) Y = A @ Omega Q, _ = np.linalg.qr(Y) B = Q.T @ A U_B, S, Vt = np.linalg.svd(B, full_matrices=False) U = Q @ U_B[:, :k] return U[:, :k], S[:k], Vt[:k, :] # Example A = np.random.randn(1000, 500) k = 10 U, S, Vt = randomized_svd(A, k) print(f"Original: {A.shape}, Compressed: {U.shape} x {S.shape}")
2.3 Error Bound
E[∣∣A−UkΣkVkT∣∣F]≤(1+p−1k)1/2∣∣A−Ak∣∣FWhere Ak is the optimal rank-k approximation and p is the oversampling parameter.
Join Discord
PreviousConcentration InequalitiesNextSpectral Graph Theory