<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879</link>
    <title>MATLAB Central Newsreader - factorize singular symmetric matrix</title>
    <description>Feed for thread: factorize singular symmetric matrix</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 29 Sep 2009 11:26:03 -0400</pubDate>
      <title>factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683363</link>
      <author>Bruno Luong</author>
      <description>Let A a real symmetric positive - but *not* definite - matrix.&lt;br&gt;
&lt;br&gt;
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 &quot;smaller&quot; vectors. This method cannot take any advantage of the symmetric positiveness of A.&lt;br&gt;
&lt;br&gt;
My A might be sparse. So I would also prefer to avoid factorization filling, but let alone this constraint for the moment.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 15:19:04 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683434</link>
      <author>Stefano </author>
      <description>maybe something like this:&lt;br&gt;
&lt;br&gt;
% this tolerance is used to determine the rank of the matrix&lt;br&gt;
tol=1e-12;&lt;br&gt;
&lt;br&gt;
% find the rank by means of Cholesky factorization&lt;br&gt;
[L,p]=chol(A);&lt;br&gt;
p=p-1;&lt;br&gt;
i=0;&lt;br&gt;
while sum(abs(L(p-i,end-i:end)).^2)&amp;lt;tol&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;i=i+1;&lt;br&gt;
end&lt;br&gt;
rk=p-i;&lt;br&gt;
&lt;br&gt;
% find the orthogonal vectors basis for the space generated by A&lt;br&gt;
U=zeros(M,rk);&lt;br&gt;
for i=1:rk&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;temp=A(:,i);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1:i-1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp=temp-U(:,j)*(U(:,j)'*temp);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;U(:,i)=temp/sqrt(sum(abs(temp).^2));&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9sqsb$7gk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Let A a real symmetric positive - but *not* definite - matrix.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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 &quot;smaller&quot; vectors. This method cannot take any advantage of the symmetric positiveness of A.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My A might be sparse. So I would also prefer to avoid factorization filling, but let alone this constraint for the moment.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 15:33:03 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683441</link>
      <author>Bruno Luong</author>
      <description>&quot;Stefano &quot; &amp;lt;s.mangione@gmail.com&amp;gt; wrote in message &amp;lt;h9t8h8$3tp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % find the rank by means of Cholesky factorization&lt;br&gt;
&amp;gt; [L,p]=chol(A);&lt;br&gt;
&lt;br&gt;
Do you think cholesky can overcome matrix such like &lt;br&gt;
&lt;br&gt;
A=[0 0; &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0 1]&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 15:50:06 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683448</link>
      <author>Stefano </author>
      <description>I assumed that there were no zeros on the diagonal... substitute that line with:&lt;br&gt;
&lt;br&gt;
[L,p]=chol(A+tol^2*eye(M));&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
&lt;br&gt;
&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9t9bf$o6b$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Stefano &quot; &amp;lt;s.mangione@gmail.com&amp;gt; wrote in message &amp;lt;h9t8h8$3tp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; % find the rank by means of Cholesky factorization&lt;br&gt;
&amp;gt; &amp;gt; [L,p]=chol(A);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Do you think cholesky can overcome matrix such like &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A=[0 0; &lt;br&gt;
&amp;gt;      0 1]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 16:01:24 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683453</link>
      <author>Bruno Luong</author>
      <description>&quot;Stefano &quot; &amp;lt;s.mangione@gmail.com&amp;gt; wrote in message &amp;lt;h9tabe$2e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I assumed that there were no zeros on the diagonal... substitute that line with:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; [L,p]=chol(A+tol^2*eye(M));&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
The problem is not the diagonal, the problem is cholesky is unable to estimate in reliable way the rank of the matrix. Another example:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;A=[1 4 4;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4 20 20;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4 20 20]&lt;br&gt;
&lt;br&gt;
This matrix has rank = 2.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 16:15:21 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683459</link>
      <author>Bruno Luong</author>
      <description>Sorry bad example previously, please use this one:&lt;br&gt;
&lt;br&gt;
A = [1     2    0     0;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2     4    0     0;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0     0    1    2;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0     0    2    4]&lt;br&gt;
&lt;br&gt;
[L,p]=chol(A) &lt;br&gt;
&lt;br&gt;
rank(A) % &amp;lt;- 2&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 17:40:20 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683485</link>
      <author>Stefano </author>
      <description>shame on me, I don't know how to get a good estimate of the rank :(&lt;br&gt;
&lt;br&gt;
moreover, the Gram Schmidt implementation above is wrong since it adds a vector to the basis even if it is zero-norm.&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
&lt;br&gt;
&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9tbqo$q6v$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Sorry bad example previously, please use this one:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A = [1     2    0     0;&lt;br&gt;
&amp;gt;        2     4    0     0;&lt;br&gt;
&amp;gt;        0     0    1    2;&lt;br&gt;
&amp;gt;        0     0    2    4]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; [L,p]=chol(A) &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; rank(A) % &amp;lt;- 2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 17:54:03 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683491</link>
      <author>Bruno Luong</author>
      <description>&quot;Stefano &quot; &amp;lt;s.mangione@gmail.com&amp;gt; wrote in message &amp;lt;h9tgq4$2aa$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; shame on me, I don't know how to get a good estimate of the rank :(&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Don't be ashamed, the problem is harder than it seems to be (at least for me).&lt;br&gt;
&lt;br&gt;
Bruno </description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 18:28:01 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683499</link>
      <author>Stefano </author>
      <description>at last, I think I've found a way to get with chol() the same reliability of the rank() function (seems faster, tested with the script at &lt;a href=&quot;http://tinyurl.com/yevnhmk&quot;&gt;http://tinyurl.com/yevnhmk&lt;/a&gt; ):&lt;br&gt;
&lt;br&gt;
tol=eps*norm(A)*numel(A);&lt;br&gt;
[L,ignored]=chol(A+tol*eye(M));&lt;br&gt;
rk=sum(abs(diag(L))&amp;gt;sqrt(sqrt(tol)));&lt;br&gt;
&lt;br&gt;
in order to get the orthogonal basis, though, I wanted to use the Gram-Schmidt algorithm; now, when the matrix is not block-diagonal, the algorithm results indeed faster than a QR; it turns out that when the matrix is block-diagonal the loop is slower than using the more straightforward QR factorization. In order to get a faster algorithm, a fast way to test for block-diagonality is needed; then it should be trivial to get a faster algorithm.&lt;br&gt;
&lt;br&gt;
Stefano &lt;br&gt;
&lt;br&gt;
&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9thjr$onk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Stefano &quot; &amp;lt;s.mangione@gmail.com&amp;gt; wrote in message &amp;lt;h9tgq4$2aa$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; shame on me, I don't know how to get a good estimate of the rank :(&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Don't be ashamed, the problem is harder than it seems to be (at least for me).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno </description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 18:39:03 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683503</link>
      <author>Bruno Luong</author>
      <description>Stefano,&lt;br&gt;
&lt;br&gt;
Note that Gram-Schmidth is nothing more than an unstable way of doing QR factorization (the later uses Householder reflection or Given rotation to &quot;orthogonalize&quot; the vectors). &lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 20:06:04 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683526</link>
      <author>Bruno Luong</author>
      <description>Stefano, I find this paper where one can find deep discussion about rank estimation based on Cholesky and QR. &lt;a href=&quot;http://eprints.ma.man.ac.uk/1193/01/covered/MIMS_ep2008_56.pdf&quot;&gt;http://eprints.ma.man.ac.uk/1193/01/covered/MIMS_ep2008_56.pdf&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Time for some reading.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 20:23:03 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683532</link>
      <author>Bruno Luong</author>
      <description>Another interesting paper.&lt;br&gt;
&lt;a href=&quot;http://www.emis.de/journals/ETNA/vol.17.2004/pp76-92.dir/pp76-92.pdf&quot;&gt;http://www.emis.de/journals/ETNA/vol.17.2004/pp76-92.dir/pp76-92.pdf&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 29 Sep 2009 23:12:02 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683558</link>
      <author>Bruno Luong</author>
      <description>&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9tpbc$7qh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Stefano, I find this paper where one can find deep discussion about rank estimation based on Cholesky and QR. &lt;a href=&quot;http://eprints.ma.man.ac.uk/1193/01/covered/MIMS_ep2008_56.pdf&quot;&gt;http://eprints.ma.man.ac.uk/1193/01/covered/MIMS_ep2008_56.pdf&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
A quick read through the paper, the author seems to suggest that Cholesky with or without pivoting are not a reliable method to estimate the rank. I try one of his example (Example 2.1) without pivoting (BTW do we have cholesky with pivoting in Matlab?) and it might overestimate the rank. He recommended QR as a better method.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Wed, 30 Sep 2009 18:09:03 -0400</pubDate>
      <title>Re: factorize singular symmetric matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261879#683762</link>
      <author>Stefano </author>
      <description>Thank you for the links. Still I think that my implementation is as robust as matlab's rank(), while being faster (and applicable only to symmetric hermitian matrices)&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
&lt;br&gt;
&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9u482$a9l$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h9tpbc$7qh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Stefano, I find this paper where one can find deep discussion about rank estimation based on Cholesky and QR. &lt;a href=&quot;http://eprints.ma.man.ac.uk/1193/01/covered/MIMS_ep2008_56.pdf&quot;&gt;http://eprints.ma.man.ac.uk/1193/01/covered/MIMS_ep2008_56.pdf&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A quick read through the paper, the author seems to suggest that Cholesky with or without pivoting are not a reliable method to estimate the rank. I try one of his example (Example 2.1) without pivoting (BTW do we have cholesky with pivoting in Matlab?) and it might overestimate the rank. He recommended QR as a better method.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno</description>
    </item>
  </channel>
</rss>

