Re: Matrix Math Question
- From: Randy Yates <yates@xxxxxxxx>
- Date: Wed, 29 Jul 2009 06:18:58 -0400
Rune Allnor <allnor@xxxxxxxxxxxx> writes:
On 28 Jul, 19:41, Tim Wescott <t...@xxxxxxxxxxxxxxxx> wrote:
I just discovered that not all matrices with all-positive eigenvalues are
positive definite (dumb, yes, and I probably used to know it, yes, but
none the less...).
I'm doing some testing, and I need to reliably generate otherwise-random
matrices that are (a) positive definite and (b) have predetermined
eigenvalues.
Anyone got any suggestions? I know how to do the part where I generate a
vector or matrix of random numbers, I'm just not sure where to go from
there...
The useful property of a positive definite matrix X
is the eigenvalue decomposition:
X = V'DV
where V is an orhogonal matrix,
V'V = I
and D is diagonal, containing the eigenvalues.
You already know the eigenvalues, so D is known.
The question, then, is how to come up with a
useful V of dimension N x N.
What I would do:
1) Generate a random vector v of size N x 1
2) Normalize the vector v to length 1
3) Use a Gram-Schmidt expansion around v
to find a complete N x N orthogonal
basis V.
4) Once you have that basis V, you are done.
In matlab the function QR performs step 3
when fed a vector.
Rune,
My LA book [meyer] tells me that the QR factoriation of an NxM matrix A produces
a matrix Q of dimension NxM and an upper-triangular matrix R of
dimension MxM, so that A = QR.
So by that definition, the QR factorization of the Nx1 vector A would be
an Nx1 vector Q and a 1x1 scalar R.
This also agrees with the notion of Gram-Schmidt orthogonalization
for the case of a set of 1 Nx1 vector {A}. The space spanned by
that vector is just range(A), and you'd expect that the dimension
of such as space to be one. Since the columns of Q form a basis
for range(A), you'd thus expect Q to have just one column.
But, as you've intimated, that isn't what Matlab (or Octave) returns. It
returns an NxN matrix Q and Nx1 vector R. What exactly is going on,
then?
--Randy
@BOOK{meyer,
title = "{Matrix Analysis and Applied Linear Algebra}",
author = "{Carl~D.~Meyer}",
publisher = "Society for Industrial and Applied Mathematics",
year = "2000"}
--
Randy Yates % "Maybe one day I'll feel her cold embrace,
Digital Signal Labs % and kiss her interface,
mailto://yates@xxxxxxxx % til then, I'll leave her alone."
http://www.digitalsignallabs.com % 'Yours Truly, 2095', *Time*, ELO
.
- Follow-Ups:
- Re: Matrix Math Question
- From: Rune Allnor
- Re: Matrix Math Question
- References:
- Matrix Math Question
- From: Tim Wescott
- Re: Matrix Math Question
- From: Rune Allnor
- Matrix Math Question
- Prev by Date: Re: removing phase shift - reversing the signal
- Next by Date: Re: Matrix Math Question
- Previous by thread: Re: Matrix Math Question
- Next by thread: Re: Matrix Math Question
- Index(es):
Relevant Pages
|