Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: factorize singular symmetric matrix
Date: Tue, 29 Sep 2009 15:19:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <h9t8h8$3tp$1@fred.mathworks.com>
References: <h9sqsb$7gk$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254237544 4025 172.30.248.35 (29 Sep 2009 15:19:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 Sep 2009 15:19:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1979926
Xref: news.mathworks.com comp.soft-sys.matlab:573697


maybe something like this:

% this tolerance is used to determine the rank of the matrix
tol=1e-12;

% find the rank by means of Cholesky factorization
[L,p]=chol(A);
p=p-1;
i=0;
while sum(abs(L(p-i,end-i:end)).^2)<tol
   i=i+1;
end
rk=p-i;

% find the orthogonal vectors basis for the space generated by A
U=zeros(M,rk);
for i=1:rk
   temp=A(:,i);
   for j=1:i-1
      temp=temp-U(:,j)*(U(:,j)'*temp);
   end
   U(:,i)=temp/sqrt(sum(abs(temp).^2));
end


Stefano


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h9sqsb$7gk$1@fred.mathworks.com>...
> Let A a real symmetric positive - but *not* definite - matrix.
> 
> What is the good way to factorize P'*A*P where P is (any - but to be found) orthogonal basis of Im(A)? In other word, am I obligate to perform QR factorization of A and throw out the "smaller" vectors. This method cannot take any advantage of the symmetric positiveness of A.
> 
> My A might be sparse. So I would also prefer to avoid factorization filling, but let alone this constraint for the moment.
> 
> Bruno