Discussion:  All Topics in Probability & Statistics 
Topic:  need help in generating feasible correlation matrices 
Post a new topic to the All Content in Probability & Statistics discussion 

Subject:  need help in generating feasible correlation matrices 
Author:  Sione 
Date:  Jan 15 2004 
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
semidefinite matrices? Is it for algorithm testing purposes or something
else?
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:
http://mathforum.org/te/exchange/hosted/palu/
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
equations.
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)
http://www.lists.apple.com/mailman/listinfo/scitech
2) JAMA (Java Matrix Algebra and Numerical Computing group mailing list from
NIST  National Institute of Standards & Technology)
http://math.nist.gov/javanumerics/jama/
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
software).
I hope this gives you a direction of where to seek further help.
Cheers,
Sione.
 
Post a new topic to the All Content in Probability & Statistics discussion  