5.0

5.0 | 2 ratings Rate this file 158 downloads (last 30 days) File Size: 1.91 KB File ID: #20600

UDFactor

by Dmitry Savransky

 

07 Jul 2008 (Updated 09 Jul 2008)

Code covered by BSD License  

Performs the U-D factorization of a symmetric matrix.

Download Now | Watch this File

File Information
Description

[U D] = UDFactor(P) returns matrices U and D such that U.'*D*U = P
[U D] = UDFactor(P,uflag) returns matrices U and D such that U*D*U.' = P
when uflag is set to TRUE. Setting uflag to FALSE is equivalent to
running UDFactor with only one argument.

The alogrithm of UDFactor is similar to the Cholesky decomposition except
that the matrix is factored into a unitary upper triangular matrix (U)
and diagonal matrix (D) such that P = U*D*U.' (or U.'*D*U). Note that
while this is equivalent to P = (U*D^0.5)*(U*D^0.5).' = S*S.' where S is
the upper triangular square root of P, no square roots are taken in the
calculations of U and D. This makes this factorization ideal for a
square-root implementation of a Kalman filter (a U-D filter). For more
details, see Bierman, G. J., Factorization methods for discrete
sequential estimation, 1977.

Note: This factorization is only guaranteed to work for symmetric
matrices.

Examples:
    %create symmetric matrix
    P = rand(5)*10;, P = triu(P)+triu(P).';
    %factor
    [U1,D1] = UDFactor(P);
    [U2,D2] = UDFactor(P,true);
    %check factorization
    P - U1.'*D1*U1
    P - U2*D2*U2.'

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
14 Jul 2008 Tim Davis

Note that this function was written for R14SP1. It's very useful there, since (if recall) there is no LDL' factorization in that version of MATLAB. In more recent versions of MATLAB, there is a new LDL' factorization function (called LDL) which does the same thing that this function does (but the built-in LDL function is a lot faster). So if you have a recent MATLAB version, use the built-in LDL function; use this one for older versions (or to read the algorithm).

Note that this function doesn't handle the sparse case.

The built-in LDL function works for all symmetric indefinite matrices. Since the function here does not handle 2-by-2 pivots, it will work for only a subset of symmetric indefinite matrices. Both this function and the built-in LDL will work fine for symmetric positive definite matrices.

However, the code here is still well written for the dense case, with ample comments. It's just that you won't need it for recent MATLAB versions except for its educational value.

08 Apr 2009 Markus Buehren  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
linear algebra Dmitry Savransky 22 Oct 2008 10:09:14
ud factorization Dmitry Savransky 22 Oct 2008 10:09:14
ud filter Dmitry Savransky 22 Oct 2008 10:09:14
ud Dmitry Savransky 22 Oct 2008 10:09:14
mathematics Dmitry Savransky 22 Oct 2008 10:09:14
linear algera Dmitry Savransky 22 Oct 2008 10:09:14
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com