You are not logged in.
login | register

Discussion: Research Area
Topic: need help in generating feasible correlation matrices

Post a new topic to the Research Area Discussion discussion
<< see all messages in this topic
<previous message | next message >

Subject:   need help in generating feasible correlation matrices
Author: Sione
Date: Jan 15 2004
Your Question is need to be specific.

First , what software (or package) do you use?

Second, What is the meaning of feasible correlation
matrices. Is it correlation between 2 vectors ( A , B)
or do you mean something else. If it is correlation between 2 vectors then use
the following algorithm:

//C is the covariance, X is the data matrix

C = COV(X);

//D is the correlation of data matrix X , 'i' and 'j' are matrix entries.

D = CORRCOEF(X) ;    
  = C(i,j)/SQRT(C(i,i)*C(j,j)) ;

Third , what is the purpose of the need to be real, symmetric, positive
semi-definite matrices? Is it for algorithm testing purposes or something

I am not aware of anything (algrithm) that need to produce a matrix that meets
all the requirement listed above. However , you should use EIGEN VALUE
DECOMPOSITION algorithm to solve for eigen values, but this appproach will
always give you real and imaginary eigen values. I use the EIGEN VALUE
DECOMPOSITION algorithm to solve polynomal roots in my "Polynomial Roots Applet"
found here:

The eigen value algorithm will always give the roots of any polynomial order in
real and complex roots, but I filtered out the complex roots for my applet just
to display only REAL ROOTS. EIGEN VALUE DECOMPOSITION requires you matrix to be
SQUARE or otherwise , it would not be able to solve your systems of linear

I do not see why you are using QR to test matrices for
real semidefinite positive matrices. QR is to factorise a matrix ( eg, X):

[Q,R] = QR(X);

The 2 matrices produced by QR , such as the example shown above are the 2
factors for matrix X, just the same as  2 and 7 are factors of the number 14 .
The  matrix factor Q is an orthogonal , ie,  Q*Q' = I , which is Q times the
transpose of Q equals the identity matrix.  Matrix factor R  is an  upper
triangular matrix. If you multiply the 2 facotrs , you will get your original
matrix X ;

X = Q*R;

I have never done trying to find out semidefinite positive matrices before , but
perhaps you should try and find it out somewhere else rather than in this forum.
I think that this forum is mainly for high school level mathematics.

I would suggest 2 forums in numerical computing where I am subscribed to. Go to
these forums site and register so that you would be able to  post questions and
also receive other posts from the list.

1)  Scitech ( Scientific Computing mailing list from Apple)

2) JAMA (Java Matrix Algebra and Numerical Computing group mailing list from
NIST - National Institute of Standards & Technology)

JAMA contains the algorithm for EIGEN VALUE DECOMPOSTION, if you program in
JAVA, however MATLAB has the algorithm too. JAMA is similar to MATLAB, in fact
it is MatLab written in Java. JAMA was developed by NIST and MathWorks ( MatLab

I hope this gives you a direction of where to seek further help.


Reply to this message          Quote this message when replying?
yes  no
Post a new topic to the Research Area Discussion discussion
Visit related discussions:
Probability & Statistics

Discussion Help