<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561</link>
    <title>MATLAB Central Newsreader - checki if a matrix is positive-semidefinite</title>
    <description>Feed for thread: checki if a matrix is positive-semidefinite</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 05 Jan 2008 00:15:25 -0500</pubDate>
      <title>checki if a matrix is positive-semidefinite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561#408101</link>
      <author>deluded.soul@gmail.com</author>
      <description>Hi everyone,&lt;br&gt;
&lt;br&gt;
How can I check if a given square matrix is positive-semidefinite in&lt;br&gt;
Matlab?&lt;br&gt;
&lt;br&gt;
Cheers,&lt;br&gt;
D&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 05 Jan 2008 00:57:55 -0500</pubDate>
      <title>Re: checki if a matrix is positive-semidefinite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561#408108</link>
      <author>Roger Stafford</author>
      <description>"deluded.soul@gmail.com" &amp;lt;deluded.soul@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;21285762-825c-4d9b-8323-6e9e65fe1cfc@j78g2000hsd.googlegroups.com&lt;br&gt;
&amp;gt;...&lt;br&gt;
&amp;gt; How can I check if a given square matrix is positive-semidefinite in&lt;br&gt;
&amp;gt; Matlab?&lt;br&gt;
-----------&lt;br&gt;
&amp;nbsp;&amp;nbsp;The matrix, A, is positive semidefinite if all the eigenvalues of its Hermitian &lt;br&gt;
part, (A+A')/2, are non-negative.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 05 Jan 2008 01:11:00 -0500</pubDate>
      <title>Re: checki if a matrix is positive-semidefinite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561#408109</link>
      <author>deluded.soul@gmail.com</author>
      <description>On Jan 5, 12:57 am, "Roger Stafford"&lt;br&gt;
&amp;lt;ellieandrogerxy...@mindspring.com.invalid&amp;gt; wrote:&lt;br&gt;
&amp;gt; "deluded.s...@gmail.com" &amp;lt;deluded.s...@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;lt;21285762-825c-4d9b-8323-6e9e65fe1...@j78g2000hsd.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; How can I check if a given square matrix is positive-semidefinite in&lt;br&gt;
&amp;gt; &amp;gt; Matlab?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; -----------&lt;br&gt;
&amp;gt;   The matrix, A, is positive semidefinite if all the eigenvalues of its Hermitian&lt;br&gt;
&amp;gt; part, (A+A')/2, are non-negative.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Hi Roger,&lt;br&gt;
&lt;br&gt;
Thanks for the reply. So, if the matrix is only composed of real&lt;br&gt;
elements than it is positive definite if all the eigenvalues are non-&lt;br&gt;
negative?&lt;br&gt;
&lt;br&gt;
The reason I ask is because I have the following matrices which has&lt;br&gt;
all positive eigenvalues:&lt;br&gt;
&lt;br&gt;
0.0017   -0.0000   -0.0002&lt;br&gt;
-0.0000    0.0005    0.0000&lt;br&gt;
-0.0002    0.0000    0.0006&lt;br&gt;
&lt;br&gt;
The eigenvalues are:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;0.0005         0         0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0    0.0006         0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0         0    0.0017&lt;br&gt;
&lt;br&gt;
Now, I expected the svd and eigenvalue decomposition to be the same&lt;br&gt;
for this matrix. The singular values and eigenvalues are indeed the&lt;br&gt;
same:&lt;br&gt;
&lt;br&gt;
However, the svd returns the following "U" matrix.&lt;br&gt;
&lt;br&gt;
0.4051    0.8347    0.3732&lt;br&gt;
-0.8868    0.4580   -0.0620&lt;br&gt;
-0.2227   -0.3058    0.9257&lt;br&gt;
&lt;br&gt;
The eigenvalue returns the following eigenvectors (they are sorted&lt;br&gt;
differently than the svd)&lt;br&gt;
0.4051    0.3732   -0.8347&lt;br&gt;
-0.8868   -0.0620   -0.4580&lt;br&gt;
-0.2227    0.9257    0.3058&lt;br&gt;
&lt;br&gt;
As you can see one of the vectors is in the different direction and I&lt;br&gt;
am trying to figure out why they do not coincide.&lt;br&gt;
&lt;br&gt;
Any ideas?&lt;br&gt;
&lt;br&gt;
Thanks again!&lt;br&gt;
&lt;br&gt;
D&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 05 Jan 2008 05:33:46 -0500</pubDate>
      <title>Re: checki if a matrix is positive-semidefinite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561#408121</link>
      <author>Roger Stafford</author>
      <description>"deluded.soul@gmail.com" &amp;lt;deluded.soul@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;8c80ce68-a0d3-4c1d-&lt;br&gt;
b3d3-3ff39f9ba7ee@c4g2000hsg.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; Thanks for the reply. So, if the matrix is only composed of real&lt;br&gt;
&amp;gt; elements than it is positive definite if all the eigenvalues are non-&lt;br&gt;
&amp;gt; negative?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The reason I ask is because I have the following matrices which has&lt;br&gt;
&amp;gt; all positive eigenvalues:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 0.0017   -0.0000   -0.0002&lt;br&gt;
&amp;gt; -0.0000    0.0005    0.0000&lt;br&gt;
&amp;gt; -0.0002    0.0000    0.0006&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The eigenvalues are:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  0.0005         0         0&lt;br&gt;
&amp;gt;       0    0.0006         0&lt;br&gt;
&amp;gt;       0         0    0.0017&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now, I expected the svd and eigenvalue decomposition to be the same&lt;br&gt;
&amp;gt; for this matrix. The singular values and eigenvalues are indeed the&lt;br&gt;
&amp;gt; same:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; However, the svd returns the following "U" matrix.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 0.4051    0.8347    0.3732&lt;br&gt;
&amp;gt; -0.8868    0.4580   -0.0620&lt;br&gt;
&amp;gt; -0.2227   -0.3058    0.9257&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The eigenvalue returns the following eigenvectors (they are sorted&lt;br&gt;
&amp;gt; differently than the svd)&lt;br&gt;
&amp;gt; 0.4051    0.3732   -0.8347&lt;br&gt;
&amp;gt; -0.8868   -0.0620   -0.4580&lt;br&gt;
&amp;gt; -0.2227    0.9257    0.3058&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As you can see one of the vectors is in the different direction and I&lt;br&gt;
&amp;gt; am trying to figure out why they do not coincide.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Any ideas?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks again!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; D&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Corresponding eigenvectors obtained by 'eig' and 'svd' will not necessarily &lt;br&gt;
be in the same direction.  Some of them can well be in opposite directions.  In &lt;br&gt;
fact, for complex-valued eigenvectors, they may differ by a complex scalar &lt;br&gt;
factor which has a modulus of one.  There is no canonical (preferred) &lt;br&gt;
direction which can be uniquely defined for eigenvectors.  The results all &lt;br&gt;
depend on the details of the particular algorithm used to determine them.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;As for the singular values obtained with 'svd', as compared with the &lt;br&gt;
eigenvalues from 'eig', they will not in general be the same unless the original &lt;br&gt;
matrix is positive semidefinite.  Singular values are always non-negative, but &lt;br&gt;
eigenvalues can easily be negative or even complex-valued.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Matlab's 'svd' always places the singular values in descending sequence, but &lt;br&gt;
there is no guarantee as to order in the eigenvalue/eigenvector sequencing &lt;br&gt;
obtained with 'eig'.  This is undoubtedly due to the fact that sorting complex-&lt;br&gt;
valued eigenvalues would be more or less meaningless.  The particular &lt;br&gt;
ordering received from an eigenvector routine is dependent on the methods &lt;br&gt;
used by the algorithm designer.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 05 Jan 2008 05:44:14 -0500</pubDate>
      <title>Re: checki if a matrix is positive-semidefinite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561#408123</link>
      <author>Roger Stafford</author>
      <description>&amp;nbsp;&amp;nbsp;Oops!  My apologies for accidentally clicking on the "Flag as spam" line instead &lt;br&gt;
of the "View original format" line just above it on this thread.  If anyone knows &lt;br&gt;
how to undo this unintended action please do so.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 05 Jan 2008 09:50:55 -0500</pubDate>
      <title>Re: checki if a matrix is positive-semidefinite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161561#408126</link>
      <author>John D'Errico</author>
      <description>"Roger Stafford" &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fln5fe$rhk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;   Oops!  My apologies for accidentally clicking on the "Flag as spam" line &lt;br&gt;
instead &lt;br&gt;
&amp;gt; of the "View original format" line just above it on this thread.  If anyone &lt;br&gt;
knows &lt;br&gt;
&amp;gt; how to undo this unintended action please do so.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&lt;br&gt;
I did it once by accident too. I ended up&lt;br&gt;
flagging enough posts as spam on one day&lt;br&gt;
that it became a reflex action. So when I&lt;br&gt;
went up there to respond to a post, I flagged&lt;br&gt;
it instead.&lt;br&gt;
&lt;br&gt;
You can't undo it. But the good news is, that&lt;br&gt;
does not matter. You hurt nothing by your&lt;br&gt;
mis-click. Since it takes 5 DIFFERENT people&lt;br&gt;
to flag something as spam, only multiple&lt;br&gt;
people making the same mistake as you do&lt;br&gt;
will cause the post to go away. And the&lt;br&gt;
probability of many people all mis-clicking&lt;br&gt;
on the same post is quite small. This is the&lt;br&gt;
wisdom of their choice to force multiple&lt;br&gt;
people to flag a post as spam.&lt;br&gt;
&lt;br&gt;
And, in the very rare event of a post&lt;br&gt;
disappearing by such a compound mistake, &lt;br&gt;
I imagine that an e-mail to our friendly&lt;br&gt;
Matlab Central administrator would resolve&lt;br&gt;
the problem.&lt;br&gt;
&lt;br&gt;
One thing that could be done is to propose&lt;br&gt;
to their team that they change the "flag as&lt;br&gt;
spam" link to a flag as spam checkbox, that&lt;br&gt;
can then be unchecked. It seems to me a&lt;br&gt;
simple enough change that they might swap&lt;br&gt;
it in on some upgrade to the site. I'm not at&lt;br&gt;
all sure it is necessary though.&lt;br&gt;
&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
