Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!c4g2000hsg.googlegroups.com!not-for-mail
From: "deluded.soul@gmail.com" <deluded.soul@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: checki if a matrix is positive-semidefinite
Date: Fri, 4 Jan 2008 17:11:00 -0800 (PST)
Organization: http://groups.google.com
Lines: 58
Message-ID: <8c80ce68-a0d3-4c1d-b3d3-3ff39f9ba7ee@c4g2000hsg.googlegroups.com>
References: <21285762-825c-4d9b-8323-6e9e65fe1cfc@j78g2000hsd.googlegroups.com> 
NNTP-Posting-Host: 81.1.126.249
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1199495461 7419 127.0.0.1 (5 Jan 2008 01:11:01 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 5 Jan 2008 01:11:01 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: c4g2000hsg.googlegroups.com; posting-host=81.1.126.249; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.11) 
Xref: news.mathworks.com comp.soft-sys.matlab:444436


On Jan 5, 12:57 am, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> "deluded.s...@gmail.com" <deluded.s...@gmail.com> wrote in message
>
> <21285762-825c-4d9b-8323-6e9e65fe1...@j78g2000hsd.googlegroups.com>...
> > How can I check if a given square matrix is positive-semidefinite in
> > Matlab?
>
> -----------
>   The matrix, A, is positive semidefinite if all the eigenvalues of its Hermitian
> part, (A+A')/2, are non-negative.
>
> Roger Stafford


Hi Roger,

Thanks for the reply. So, if the matrix is only composed of real
elements than it is positive definite if all the eigenvalues are non-
negative?

The reason I ask is because I have the following matrices which has
all positive eigenvalues:

0.0017   -0.0000   -0.0002
-0.0000    0.0005    0.0000
-0.0002    0.0000    0.0006

The eigenvalues are:

 0.0005         0         0
      0    0.0006         0
      0         0    0.0017

Now, I expected the svd and eigenvalue decomposition to be the same
for this matrix. The singular values and eigenvalues are indeed the
same:

However, the svd returns the following "U" matrix.

0.4051    0.8347    0.3732
-0.8868    0.4580   -0.0620
-0.2227   -0.3058    0.9257

The eigenvalue returns the following eigenvectors (they are sorted
differently than the svd)
0.4051    0.3732   -0.8347
-0.8868   -0.0620   -0.4580
-0.2227    0.9257    0.3058

As you can see one of the vectors is in the different direction and I
am trying to figure out why they do not coincide.

Any ideas?

Thanks again!

D