Canonical correlation analysis is used to identify and measure the associations among two sets of variables. Canonical correlation is appropriate in the same situations where multiple regression would be, but where are there are multiple intercorrelated outcome variables. Canonical correlation. Purpose of Canonical Correlation Analysis Canonical Correlation Analysis (CCA)connects two sets of variables by ï¬nding linear combinations of variables that maximally correlate. There are two typical purposes of CCA: 1 Data reduction: explain covariation between two sets of variables using small number of linear combinations.
In statistics, canonical-correlation analysis (CCA), also called canonical variates analysis, is a way of inferring information from cross-covariance matrices. If we have two vectors X = (X1, ..., Xn) and Y = (Y1, ..., Ym) of random variables, and there are correlations among the variables, then canonical-correlation analysis will find linear combinations of X and Y which have maximum correlation with each other.[1] T. R. Knapp notes that 'virtually all of the commonly encountered parametric tests of significance can be treated as special cases of canonical-correlation analysis, which is the general procedure for investigating the relationships between two sets of variables.'[2] The method was first introduced by Harold Hotelling in 1936,[3] although in the context of angles between flats the mathematical concept was published by Jordan in 1875.[4]
Definition[edit]
Given two column vectorsX=(x1,â¦,xn)â²{displaystyle X=(x_{1},dots ,x_{n})'} and Y=(y1,â¦,ym)â²{displaystyle Y=(y_{1},dots ,y_{m})'} of random variables with finitesecond moments, one may define the cross-covarianceΣXY=covâ¡(X,Y){displaystyle Sigma _{XY}=operatorname {cov} (X,Y)} to be the nÃm{displaystyle ntimes m}matrix whose (i,j){displaystyle (i,j)} entry is the covariancecovâ¡(xi,yj){displaystyle operatorname {cov} (x_{i},y_{j})}. In practice, we would estimate the covariance matrix based on sampled data from X{displaystyle X} and Y{displaystyle Y} (i.e. from a pair of data matrices).
Canonical-correlation analysis seeks vectors a{displaystyle a} (a{displaystyle a}âRn{displaystyle in mathbb {R} ^{n}} ) and b{displaystyle b} (bâRm{displaystyle bin mathbb {R} ^{m}}) such that the random variables aTX{displaystyle a^{T}X} and bTY{displaystyle b^{T}Y} maximize the correlationÏ=corrâ¡(aTX,bTY){displaystyle rho =operatorname {corr} (a^{T}X,b^{T}Y)}. The random variables U=aTX{displaystyle U=a^{T}X} and V=bTY{displaystyle V=b^{T}Y} are the first pair of canonical variables. Then one seeks vectors maximizing the same correlation subject to the constraint that they are to be uncorrelated with the first pair of canonical variables; this gives the second pair of canonical variables. This procedure may be continued up to min{m,n}{displaystyle min{m,n}} times.
(aâ²,bâ²)=argmaxa,bcorrâ¡(aTX,bTY){displaystyle (a',b')={underset {a,b}{operatorname {argmax} }}operatorname {corr} (a^{T}X,b^{T}Y)}
Computation[edit]Derivation[edit]
Let ΣXX=covâ¡(X,X){displaystyle Sigma _{XX}=operatorname {cov} (X,X)} and ΣYY=covâ¡(Y,Y){displaystyle Sigma _{YY}=operatorname {cov} (Y,Y)}. The parameter to maximize is
The first step is to define a change of basis and define
And thus we have
By the CauchyâSchwarz inequality, we have
Canonical Correlation Analysis Tutorial
There is equality if the vectors d{displaystyle d} and ΣYYâ1/2ΣYXΣXXâ1/2c{displaystyle Sigma _{YY}^{-1/2}Sigma _{YX}Sigma _{XX}^{-1/2}c} are collinear. In addition, the maximum of correlation is attained if c{displaystyle c} is the eigenvector with the maximum eigenvalue for the matrix ΣXXâ1/2ΣXYΣYYâ1ΣYXΣXXâ1/2{displaystyle Sigma _{XX}^{-1/2}Sigma _{XY}Sigma _{YY}^{-1}Sigma _{YX}Sigma _{XX}^{-1/2}} (see Rayleigh quotient). The subsequent pairs are found by using eigenvalues of decreasing magnitudes. Orthogonality is guaranteed by the symmetry of the correlation matrices.
Another way of viewing this computation is that c{displaystyle c} and d{displaystyle d} are the left and right singular vectors of the correlation matrix of X and Y corresponding to the highest singular value.
Solution[edit]
The solution is therefore:
Reciprocally, there is also:
Reversing the change of coordinates, we have that
The canonical variables are defined by:
Implementation[edit]
CCA can be computed using singular value decomposition on a correlation matrix.[5] It is available as a function in[6]
![]()
CCA computation using singular value decomposition on a correlation matrix is related to the cosine of the angles between flats. The cosine function is ill-conditioned for small angles, leading to very inaccurate computation of highly correlated principal vectors in finite precisioncomputer arithmetic. To fix this trouble, alternative algorithms[7] are available in
Hypothesis testing[edit]
Each row can be tested for significance with the following method. Since the correlations are sorted, saying that row i{displaystyle i} is zero implies all further correlations are also zero. If we have p{displaystyle p} independent observations in a sample and Ï^i{displaystyle {widehat {rho }}_{i}} is the estimated correlation for i=1,â¦,min{m,n}{displaystyle i=1,dots ,min{m,n}}. For the i{displaystyle i}th row, the test statistic is:
which is asymptotically distributed as a chi-squared with (mâi+1)(nâi+1){displaystyle (m-i+1)(n-i+1)}degrees of freedom for large p{displaystyle p}.[8] Since all the correlations from min{m,n}{displaystyle min{m,n}} to p{displaystyle p} are logically zero (and estimated that way also) the product for the terms after this point is irrelevant.
Note that in the small sample size limit with p<n+m{displaystyle p<n+m} then we are guaranteed that the top m+nâp{displaystyle m+n-p} correlations will be identically 1 and hence the test is meaningless.[9]
Canonical Correlation In RPractical uses[edit]
A typical use for canonical correlation in the experimental context is to take two sets of variables and see what is common among the two sets.[10] For example, in psychological testing, one could take two well established multidimensional personality tests such as the Minnesota Multiphasic Personality Inventory (MMPI-2) and the NEO. By seeing how the MMPI-2 factors relate to the NEO factors, one could gain insight into what dimensions were common between the tests and how much variance was shared. For example, one might find that an extraversion or neuroticism dimension accounted for a substantial amount of shared variance between the two tests.
One can also use canonical-correlation analysis to produce a model equation which relates two sets of variables, for example a set of performance measures and a set of explanatory variables, or a set of outputs and set of inputs. Constraint restrictions can be imposed on such a model to ensure it reflects theoretical requirements or intuitively obvious conditions. This type of model is known as a maximum correlation model.[11]
Visualization of the results of canonical correlation is usually through bar plots of the coefficients of the two sets of variables for the pairs of canonical variates showing significant correlation. Some authors suggest that they are best visualized by plotting them as heliographs, a circular format with ray like bars, with each half representing the two sets of variables.[12]
Examples[edit]
Let X=x1{displaystyle X=x_{1}} with zero expected value, i.e., Eâ¡(X)=0{displaystyle operatorname {E} (X)=0}. If Y=X{displaystyle Y=X}, i.e., X{displaystyle X} and Y{displaystyle Y} are perfectly correlated, then, e.g., a=1{displaystyle a=1} and b=1{displaystyle b=1}, so that the first (and only in this example) pair of canonical variables is U=X{displaystyle U=X} and V=Y=X{displaystyle V=Y=X}. If Y=âX{displaystyle Y=-X}, i.e., X{displaystyle X} and Y{displaystyle Y} are perfectly anticorrelated, then, e.g., a=1{displaystyle a=1} and b=â1{displaystyle b=-1}, so that the first (and only in this example) pair of canonical variables is U=X{displaystyle U=X} and V=âY=X{displaystyle V=-Y=X}. We notice that in both cases U=V{displaystyle U=V}, which illustrates that the canonical-correlation analysis treats correlated and anticorrelated variables similarly.
Connection to principal angles[edit]
Assuming that X=(x1,â¦,xn)â²{displaystyle X=(x_{1},dots ,x_{n})'} and Y=(y1,â¦,ym)â²{displaystyle Y=(y_{1},dots ,y_{m})'} have zero expected values, i.e., Eâ¡(X)=Eâ¡(Y)=0{displaystyle operatorname {E} (X)=operatorname {E} (Y)=0}, their covariance matrices ΣXX=Covâ¡(X,X)=Eâ¡[XXâ²]{displaystyle Sigma _{XX}=operatorname {Cov} (X,X)=operatorname {E} [XX']} and ΣYY=Covâ¡(Y,Y)=Eâ¡[YYâ²]{displaystyle Sigma _{YY}=operatorname {Cov} (Y,Y)=operatorname {E} [YY']} can be viewed as Gram matrices in an inner product for the entries of X{displaystyle X} and Y{displaystyle Y}, correspondingly. In this interpretation, the random variables, entries xi{displaystyle x_{i}} of X{displaystyle X} and yj{displaystyle y_{j}} of Y{displaystyle Y} are treated as elements of a vector space with an inner product given by the covariancecovâ¡(xi,yj){displaystyle operatorname {cov} (x_{i},y_{j})}; see Covariance#Relationship to inner products.
The definition of the canonical variables U{displaystyle U} and V{displaystyle V} is then equivalent to the definition of principal vectors for the pair of subspaces spanned by the entries of X{displaystyle X} and Y{displaystyle Y} with respect to this inner product. The canonical correlations corrâ¡(U,V){displaystyle operatorname {corr} (U,V)} is equal to the cosine of principal angles.
Whitening and probabilistic canonical correlation analysis[edit]
CCA can also be viewed as special whitening transformation where random vectors X{displaystyle X} and Y{displaystyle Y} are simultaneously transformed in such a way that the cross-correlation between the whitened vectors XCCA{displaystyle X^{CCA}} and YCCA{displaystyle Y^{CCA}} is diagonal.[13]The canonical correlations are then interpreted as regression coefficients linking XCCA{displaystyle X^{CCA}} and YCCA{displaystyle Y^{CCA}} and may also be negative. The regression view of CCA also provides a way to construct a latent variable probabilistic generative model for CCA, with uncorrelated hidden variables representing shared and non-shared variability.
See also[edit]References[edit]
External links[edit]
Canonical Correlation Analysis Example Pdf
Canonical Correlation Analysis R Code
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Canonical_correlation&oldid=906579811'
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |