# SVD

0th

Percentile

##### Singular Value Decomposition of a Matrix

Compute the singular-value decomposition of a matrix $X$ either by Jacobi rotations (the default) or from the eigenstructure of $X'X$ using Eigen. Both methods are iterative. The result consists of two orthonormal matrices, $U$, and $V$ and the vector $d$ of singular values, such that $X = U diag(d) V'$.

SVD(X, method = c("Jacobi", "eigen"), tol = sqrt(.Machine$double.eps), max.iter = 100) ##### Arguments X a square symmetric matrix method either "Jacobi" (the default) or "eigen" tol zero and convergence tolerance max.iter maximum number of iterations ##### Details The default method is more numerically stable, but the eigenstructure method is much simpler. Singular values of zero are not retained in the solution. ##### Value a list of three elements: d-- singular values, U-- left singular vectors, V-- right singular vectors ##### See Also svd, the standard svd function Eigen ##### Aliases • SVD ##### Examples # NOT RUN { C <- matrix(c(1,2,3,2,5,6,3,6,10), 3, 3) # nonsingular, symmetric C SVD(C) # least squares by the SVD data("workers") X <- cbind(1, as.matrix(workers[, c("Experience", "Skill")])) head(X) y <- workers$Income
VdU <- svd$V %*% diag(1/svd$d) %*%t(svd\$U)