Lecturer
School of Sport Science, Bangor University, UK
On a computer press F11 to de/activate full-screen view.
QR code to
these slides:
EEG activity features, Y: observations × features (a toy: six participants, two conditions, three features)
| subj | cond | Y(1) | Y(2) | Y(3) |
|---|---|---|---|---|
| 1 | A | 4 | 6 | 3 |
| 1 | B | 3 | 4 | 2 |
| 2 | A | 6 | 4 | 3 |
| 2 | B | 5 | 3 | 4 |
| 3 | A | 5 | 6 | 3 |
| 3 | B | 4 | 5 | 3 |
Design, X: observations × contrasts. One within-subjects contrast.
| subj | cond | X(1) |
|---|---|---|
| 1 | A | +1 |
| 1 | B | −1 |
| 2 | A | +1 |
| 2 | B | −1 |
| 3 | A | +1 |
| 3 | B | −1 |
Y are centered on that participant’s mean (subject centring): with two conditions, each pair (A, B) becomes (+d/2, −d/2), where d = A − BY are standardised (Z-scores)After centring, every dot product between a column of X and a column of Y is a covariance; with standardisation, a correlation.
Dot product (vectors): multiply pairs of numbers, add up all the products.
\[ \mathbf{a} = \begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix}, \; \mathbf{b} = \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix}, \quad \mathbf{a}^{\top}\mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3 \]
Matrix multiplication: every row of the first against every column of the second; each cell is one dot product.
\[ (X^{\top}Y)_{ij} = \text{dot product of column } i \text{ of } X \text{ with column } j \text{ of } Y \]
X is (m × pX), Y is (m × pY): XᵀY is (pX × pY) (i.e., one row per column of X, one column per column of Y)\[ C = \frac{X^{\top} Y}{m-1} \]
one row per contrast of X, one column per feature of Y: here 1 × 3
each entry: the covariance (or correlation) between the contrast and that feature
| subj | cond | x | Y(1) | x · Y(1) |
|---|---|---|---|---|
| 1 | A | +1 | 4 | +4 |
| 1 | B | −1 | 3 | −3 |
| 2 | A | +1 | 6 | +6 |
| 2 | B | −1 | 5 | −5 |
| 3 | A | +1 | 5 | +5 |
| 3 | B | −1 | 4 | −4 |
in real data: thousands of features, thousands of numbers, one row
The division by (m − 1) makes each entry a covariance. Not essential for the SVD or the permutation test (it scales everything equally, so loadings, p-values do not depend).
imagine thousands of features (i.e., axes)… well, we can’t…
directions (eigenvectors) and their sizes (eigenvalues) come out of the covariance matrix of the features with themselves (YᵀY / (m − 1)):
one block, one set of directions
each direction is a weighted combination of all features
the first direction captures the most variance; the second the most of what is left; and so on
PCA decomposes the covariance of one block with itself (YᵀY / (m − 1)). PLS-SVD decomposes the cross-covariance between two blocks, XᵀY / (m − 1)
PCA works on square matrices (YᵀY / (m − 1) is always square). PLS-SVD works on rectangular matrices (XᵀY / (m − 1) has one row per contrast of X, one column per feature of Y).
PCA returns one set of directions (eigenvectors) and their sizes (eigenvalues). PLS-SVD returns two sets of paired directions (left and right singular vectors) and their sizes (singular values). The left singular vectors are the directions across the rows of XᵀY / (m − 1) (combinations of contrasts of X), and the right singular vectors are the directions across the columns of XᵀY / (m − 1) (combinations of features of Y)
The eigenvalues are the variance in YᵀY / (m − 1) captured by each direction. The singular values are the covariance in XᵀY / (m − 1) captured by each pair of directions
\[ C = U \, S \, V^{\top} \]
In our specific within-subject paired comparison case…
X’s left singular vector (U) is just a single number (i.e., -/+1);
Y’s right singular vector (V) is a weighted combination of the features that is most strongly associated with the contrast
in other words, what is decomposed is the association between the contrasts and the features
all singular vectors are unit length, and the singular values are non-negative and ordered from largest to smallest
Exchangeability in a within-subject design: within each participant, the rows of Y swap; X keeps its values.
For each iteration: swap, recompute C, recompute the SVD, keep the singular value.
The p-value refers to the singular value: the pattern as a whole. no claim about any individual feature… similar to clusters.
PLS correlation does not localise. Where the effect is, in time or space, is read from the loadings descriptively.
Bootstrap ratios describe reliability under resampling… not a significant feature.