Multivariate permutation testing: PLS-SVD

(for EEG, one mode)

Dr Germano Gallicchio

Lecturer

School of Sport Science, Bangor University, UK

profile | research | software | learning resources


On a computer press F11 to de/activate full-screen view.

QR code to
these slides:

Partial Least What? Singular What Decomposition?

steps A econometrics NIPALS, H. and S. Wold, 60-70s B omics PLS regression, S. Wold, 70s-80s A->B C neuroimaging PLS-SVD, McIntosh, 90s A->C

Two matrices

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

Before multiplying: center the columns

  • in a within-subject design, each participant’s rows of matrix 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 − B
  • then, both matrices are then column-centred (the mean of every column is subtracted)
  • optionally, the columns of Y 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 and matrix multiplication

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 \]

  • if \(\mathbf{a}\) and \(\mathbf{b}\) are column-centred: \(\mathbf{a}^{\top}\mathbf{b}/(m-1)\) = covariance
  • if also standardised: \(\mathbf{a}^{\top}\mathbf{b}/(m-1)\) = correlation

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)

cross-product matrix

\[ 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).

PCA, the simpler cousin, intuitively

  • one point per observation (e.g., subjects, the rows of X and Y), two features (the columns of Y) as axes
  • each new axis is a direction, a weighted combination of the original features of Y
  • the spread along each axis is its size, how much variance it captures
  • directions at right angles, ordered by size

The same in many dimensions

  • 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

PLS-SVD is PCA’s more complex cousin

  1. 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)

  2. 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).

  3. 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)

  4. 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


Singular Value Decomposition (SVD): what comes out

\[ C = U \, S \, V^{\top} \]

Z = U S Vᵀ rows × columns = (rows × K) · (K × K, diagonal) · (K × columns)

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

permutation testing on the singular value

  • 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.

latentLoop S swap conditions within participants C cross-product matrix C S->C D SVD C->D X keep the singular value D->X X->S repeat × 10,000 H empirical H0 distribution of singular values X->H

Caveats

  1. The p-value refers to the singular value: the pattern as a whole. no claim about any individual feature… similar to clusters.

  2. PLS correlation does not localise. Where the effect is, in time or space, is read from the loadings descriptively.

  3. Bootstrap ratios describe reliability under resampling… not a significant feature.