File Exchange

image thumbnail

Full Rank Factorization

version 1.2 (1.99 KB) by

Performs a full rank factorization, X=KL

4 Downloads

Updated

View License

FRD - Full rank factorization of input matrix X.

This will write X as the product of two matrices X = KL where both K and L have the same rank as X.

Comments and Ratings (2)

gemg

gemg (view profile)

Tim Davis

This function simply calls the MATLAB rref.m function, and then "determines" the rank of the matrix by looking at the number of zeros on the diagonal of the reduced matrix; the corresponding rows are then removed. This method has several problems. First, rref.m is not one of the computational workhorses of MATLAB. It is quite slow for large matrices. The SVD is more accurate, and faster in this case becase the SVD is built-in but RREF is an M-file (and a slow one at that). RREF is in MATLAB not for production use, but more for educational purposes. Second, looking for exact zeros is not appropriate. You should at least ensure the matrix is well-scaled, and then look for small values, not zeros. Your method is prone to errors due to trivial round-off errors.

I timed the SVD and FRD on the matrix rand(1000), which is full rank. The SVD took 19 seconds, whereas FRD took 79 seconds. The former is vastly more accurate and robust than this code, and 4 times faster.

Updates

1.2

Rounding issue is resolved.

1.1

The factorization is now based on the SVD of the input matrix.

MATLAB Release
MATLAB 7.4 (R2007a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today