Suppose that X has a singular value decomposition
n nonzero singular values (nonzero elements of w);
the smallest nonzero singular value is .
X is of rank n
X differs from a matrix Y of rank n-1 by ;
no matrix of rank n-1 differs from X by less than ;
we may compute one such matrix Y as follows:
is of rank n-1 and differs from X by , where w2 is w with replaced by 0.
If, for example, X had 5 nonzero singular values and the smallest one was .15, then we could say that the rank of X was 4.15 . and if we replace the .15 in w by 0 in w2 and compute Y, we get a matrix Y of rank 4 which differs from X by as little as possible.
i remark that i do this by changing a value in the matrix w, leaving u and v alone; hence Y is the same shape as X. There are those who would drop a row and column from w, then drop a column from each of u and v. (see below under alternative SVD.)