Matrix Singular Value Decomposition (SVD) Using the Jacobi Algorithm from Scratch JavaScript | James D. McCaffrey
If you have a matrix A and apply singular value decomposition (SVD) to it, you get a matrix U, a vector s, and a matrix Vh so that A = U * S * Vh where S is a matrix with the elements of vector s on the diagonal. Writing a function to compute SVD is extremely difficult and there are several algorithms. A few weeks ago I implemented a from-scratch SVD version using raw JavaScript, but I wasn’t at all happy with it — it just didn’t feel right. See https://jamesmccaffrey.wordpress.com/2023/11/21/matrix-singular-value-decomposition-svd-from-scratch-using-javascript/. So, one evening on an Alaska Airlines flight from Minneapolis to Seattle, I decided to refactor the GNU Scientific Library (GSL) function gsl_linalg_SV_decomp_jacobi() from C to JavaScript. I did so but only after many hours of effort. The GSL version is at github.com/ampl/gsl/blob/master/linalg/svd.c and is called the Jacobi algorithm version of SVD. Most of my time was spent on implementing a lot of JavaScript helper functio
Matrix Singular Value Decomposition (SVD) Using the Jacobi Algorithm from Scratch JavaScript - James D. McCaffreyJames D. McCaffrey James D. McCaffrey Software Research, Development, Testing, and Education Skip to content Home About Me Publications Recent Technical Journals Books and e-Books Research Papers Old Publications Archive ← “Microsoft Stirs Interest with Small, Fine-Tuned Orca-2 LLM” on the Pure AI Web Site Schur Decomposition Using the QR Algorithm → Matrix Singular Value Decomposition (SVD) Using the Jacobi Algorithm from Scratch JavaScript Posted on January 5
Explore this link on the map →saved by
related reading
- Singular value decomposition - Wikipediaen.wikipedia.org
- Singular Value Decomposition as Simply as Possiblegregorygundersen.com
- matrixcookbook.pdfmath.uwaterloo.ca
- https://www.deeplearningbook.org/contents/linear_algebra.htmldeeplearningbook.org
- pca - What is the intuition behind SVD? - Cross Validatedstats.stackexchange.com
- dimensionality reduction - Relationship between SVD and PCA. How to use SVD to perform PCA? - Cross Validatedstats.stackexchange.com
- Six (and a half) intuitions for SVD — LessWronglesswrong.com
- Matrices (linear algebra) - SymPy 1.14.0 documentationdocs.sympy.org
- An Intuitive Guide to Linear Algebra – BetterExplainedbetterexplained.com
- [1305.5870] The Optimal Hard Threshold for Singular Values is 4/sqrt(3)arxiv.org
- Pen and Paper Exercises in Machine Learningarxiv.org
- Jordan normal form - Wikipediaen.wikipedia.org