s-news
[Top] [All Lists]

PCA - correlation matrix question

To: s-news@lists.biostat.wustl.edu
Subject: PCA - correlation matrix question
From: Martyn Colins <martyncollins10@yahoo.com>
Date: Mon, 14 Aug 2006 04:35:06 -0700 (PDT)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=GOVvGCB3pjHhWx3t+CnUkeuA7RmRmFjNHS7PRfeudrBPlN+bjgNfgqDqItJI7H25dZRIZwGpN2WULZHxbc8TxrBs4tK7zCnx1JGOolczytCMTOchXlwqiU155buoNKZJTs5n/r0wQjnWS4kH33vM9tJRGC5Y43++JI/BYcZaJmU= ;
 
Dear all,
 
Suppose I define the following correlation matrix:
 
my.matrix <- matrix(1, 20, 20)
my.matrix[row(my.matrix) > col(my.matrix)]  <- c(
 0.5, 0.2, 0.1, rep(0.2, 2), 0.15, 0.3, 0.2, 0.3, rep(0.2, 2), rep(0.1, 2), 0.2, rep(0.4, 2), 0, rep(0.2, 2),0.1, 0, 0.2, 0.15, rep(0.1, 3), 0.3, rep(0.15, 2), rep(0, 2), 0.15, rep(0.4, 2), 0, 0.15, 0, 0.2, 0.3, 0, 0.1, rep(0, 2) , 0.1, rep(0, 2), 0.5, 0.2, rep(0, 5), 0.2, 0.3, rep(0.1, 7), 0.3, rep(0.1, 7), rep(0.4, (16*15)/2))
 
my.matrix[row(my.matrix)<col(my.matrix)] <- t(my.matrix)[row(my.matrix)<col(my.matrix)]
 
 
Then I calculate the eigenvectors associated with this correlation matrix:
 
my.pca.vec <- eigen(my.matrix, symmetric=T)$vectors
 
Check to see whether the eigenvectors are independent:

round(crossprod(my.pca.vec),12)
This produces the identity matrix as expected. This should be the same as:
 
round(cor(my.pca.vec), 12)
 
However, this doesn't produce the identity matrix - some of the off-diagonal terms are non-zero.
 
Is this supposed to happen?
 
Thanks in advance for any help.
 
Regards,
Martyn


Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
<Prev in Thread] Current Thread [Next in Thread>
  • PCA - correlation matrix question, Martyn Colins <=