
This tutorial will show you how to perform canonical correlation analysis with PRAAT.
In canonical correlation analysis we try to find the correlations between two data sets. One data set is called the dependent set, the other the independent set. In PRAAT these two sets must reside into one TableOfReal object. The lower numbered columns of this table will then be interpreted as the dependent part, the rest of the columns as the independent part. The dimension of, i.e., the number of columns in, the dependent part may not exceed the dimension of the independent part.
As an example, we will use the dataset from Pols et al. (1973) with the frequencies and levels of the first three formants from the 12 Dutch monophthongal vowels as spoken in /h_t/ context by 50 male speakers. We will try to find the canonical correlation between formant frequencies (the dependent part) and levels (the independent part). The dimension of both groups of variates is 3. In the introduction of the discriminant analysis tutorial you can find how to get these data, how to take the logarithm of the formant frequency values and how to standardize them. The following script summarizes:
pols50m = Create TableOfReal (Pols 1973): "yes"
Formula: "if col < 4 then log10 (self) else self endif"
Standardize columns
Before we start with the canonical correlation analysis we will first have a look at the Pearson correlations of this table and calculate the Correlation matrix. It is given by:
F1 F2 F3 L1 L2 L3
F1 1 0.338 0.191 0.384 0.505 0.014
F2 0.338 1 0.190 0.106 0.526 0.568
F3 0.191 0.190 1 0.113 0.038 0.019
L1 0.384 0.106 0.113 1 0.038 0.085
L2 0.505 0.526 0.038 0.038 1 0.128
L3 0.014 0.568 0.019 0.085 0.128 1
The following script summarizes:
selectObject: pols50m
To Correlation
Draw as numbers: 1, 0, "decimal", 3
The correlation matrix shows that high correlations exist between some formant frequencies and some levels. For example, the correlation coefficient between F2 and L2 equals 0.526.
In a canonical correlation analysis of the dataset above, we try to find the linear combination u_{1} of F_{1}, F_{2} and F_{3} that correlates maximally with the linear combination v_{1} of L_{1}, L_{2} and L_{3}. When we have found these u_{1} and v_{1} we next try to find a new combination u_{2} of the formant frequencies and a new combination v_{2} of the levels that have maximum correlation. These u_{2} and v_{2} must be uncorrelated with u_{1} and v_{1}. When we express the above with formulas we have:
u_{1} = y_{11}F_{1}+y_{12}F_{2} + y_{13}F_{3} 
v_{1} = x_{11}L_{1}+x_{12}L_{2} + x_{13}L_{3} 
ρ(u_{1}, v_{1}) = maximum, ρ(u_{2}, v_{2}) = submaximum, 
ρ(u_{2}, u_{1}) = ρ (u_{2}, v_{1}) = ρ (v_{2}, v_{1}) = ρ (v_{2}, u_{1}) = 0, 
where the ρ(u_{i}, v_{i}) are the correlations between the canonical variates u_{i} and v_{i} and the y_{ij}'s and x_{ij}'s are the canonical coefficients for the dependent and the independent variates, respectively.
Select the TableOfReal and choose from the dynamic menu the option To CCA.... This command is available in the "Multivariate statistics" action button. We fill out the form and supply 3 for Dimension of dependent variate. The resulting CCA object will bear the same name as the TableOfReal object. The following script summarizes:
selectObject: pols50m
cca = To CCA: 3
You can get the canonical correlation coefficients by queries of the CCA object. You will find that the three canonical correlation coefficients, ρ(u_{1}, v_{1}), ρ(u_{2}, v_{2}) and ρ(u_{3}, v_{3}) are approximately 0.86, 0.53 and 0.07, respectively. The following script summarizes:
cc1 = Get correlation: 1
cc2 = Get correlation: 2
cc3 = Get correlation: 3
writeInfoLine: "cc1 = ", cc1, ", cc2 = ", cc2, ", cc3 = ", cc3
Canonical scores, also named canonical variates, are the linear combinations:
u_{i} = y_{i1}F_{1}+y_{i2}F_{2} + y_{i3}F_{3}, and, 
v_{i} = x_{i1}L_{1}+x_{i2}L_{2} + x_{i3}L_{3}, 
where the index i runs from 1 to the number of correlation coefficients.
You can get the canonical scores by selecting a CCA object together with the TableOfReal object and choose To TableOfReal (scores)...
When we now calculate the Correlation matrix of these canonical variates we get the following table:
u1 u2 u3 v1 v2 v3
u1 1 . . 0.860 . .
u2 . 1 . . 0.531 .
u3 . . 1 . . 0.070
v1 0.860 . . 1 . .
v2 . 0.1 . . 1 .
v3 . . 0.070 . . 1
The scores with a dot are zero to numerical precision. In this table the only correlations that differ from zero are the canonical correlations. The following script summarizes:
selectObject: cca, pols50m
To TableOfReal (scores): 3)
To Correlation
Draw as numbers if: 1, 0, "decimal", 2, "abs(self) > 1e14
Additional information can be found in Weenink (2003).
© djmw, May 9, 2014