Level 5 L5.2 statistics thread

Sensor-space connectivity

Coherence, PLV, PLI/wPLI, imaginary coherence and orthogonalized envelope correlation; what each is robust to; directed measures; surrogate testing.

~75 min Notebook: nb-5-2-connectivity

Prerequisites: L5.1 · Volume conduction: the central problem

4 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a primary source. Everything else on this page has been reviewed. Treat a marked claim as provisional and go to the cited source rather than quoting the sentence.

Objectives

  • Compute coherence, PLV, PLI/wPLI, imaginary coherence and orthogonalized envelope correlation
  • State what each measure is robust to
  • Recognize directed measures (Granger, DTF, PDC) and their assumptions
  • Test connectivity with surrogates

Why this matters

L5.1 left you with a head full of perfectly coherent sensors and one generator. This lesson is the catalogue of what you can compute instead — and, just as importantly, what each of those alternatives gives up in exchange. None of them is “the connectivity measure”. Each one discards a specific part of the signal, and choosing one is choosing which class of true effects you are willing to become blind to.

Concepts

Everything here comes out of one object: the cross-spectrum

Take two channels, cut them into segments (or trials), Fourier-transform each segment. For every frequency you now have two complex numbers per segment, X_i and X_j. The cross-spectrum is their average product S_ij = mean over segments of X_i · X_j* — a complex number whose magnitude says how much the two covary at that frequency and whose phase is the average phase difference between them.

Normalise it by the two auto-spectra and you get coherency, a complex number in the unit disc:

C_ij(f) = S_ij / sqrt(S_ii · S_jj)

Every symmetric measure in this lesson is a different way of collapsing that complex number — or the cloud of per-segment values behind it — to a single real one. Draw the per-segment cross-spectral values in the complex plane and the whole taxonomy becomes visible: volume conduction piles them on the real axis, on one side or the other; a true lagged interaction pushes them off it.

The measures, and what each one throws away

MeasureWhat it isZero-lag mixing produces it?What it cannot see
Coherence, abs(C) squaredmagnitude of coherency, squaredyes, at the ceilingnothing is discarded, so nothing is protected
PLVmagnitude of the mean unit phasor, abs(mean of exp(i·Δφ))yes, at the ceilingamplitude covariation (by design); also nothing about lag is discarded
Imaginary coherence, Im(C)the projection of coherency onto the imaginary axisno, it is identically zeroany genuine interaction at or near zero lag; also shrinks as the interaction’s lag approaches half a cycle
PLIabs(mean of sign(Im(S_ij))) — how consistently one channel leadsnozero-lag interactions; and it is discontinuous, so small perturbations near zero phase difference flip the sign
wPLIthe same, weighted by abs(Im(S_ij))nozero-lag interactions; less jumpy than PLI near zero because near-real samples get little weight
Orthogonalized envelope correlationremove the zero-phase-lag component of one signal with respect to the other, then correlate the amplitude envelopesnozero-lag amplitude coupling; and it measures a slower, envelope-scale relationship than the phase measures do

Two properties are worth separating carefully, because they are routinely conflated.

Insensitive to mixing is not the same as unaffected by mixing. The imaginary part of coherency cannot be created by instantaneous mixing, which is the guarantee. But mixing still adds a large, shared, zero-lag term to both signals, and that term inflates the denominators S_ii and S_jj. So a real lagged interaction measured through heavy mixing comes out smaller than it is. The measure is protected against false positives of one particular kind; it is not protected against attenuation, and it is certainly not a measure of “true connectivity” with the mixing removed.

Robustness costs sensitivity in an exactly specified place. All four robust measures are blind to genuine zero-lag coupling. That is not a corner case: neural interactions with short conduction delays sit near zero lag, and a common driver of two regions produces a real zero-lag relationship. A wPLI of zero is consistent with “no interaction” and equally consistent with “a strong instantaneous one”. The Level 5 discipline is to say which of those your design can distinguish, and usually it cannot.

PLV, amplitude and what “connectivity” is being claimed

Coherence mixes two things: whether the phase difference is consistent, and whether the amplitudes covary. PLV isolates the first by throwing away amplitude entirely. Envelope correlation isolates roughly the second. They answer different questions and can disagree — two regions can be phase-locked without their amplitudes covarying, and vice versa — so the measure has to be named in every sentence that reports a result. “Connectivity between frontal and parietal sites” is not a finding; “wPLI in 8–12 Hz between these two channel groups” is.

Reference dependence is not a detail

Every measure above is computed on channel time series, and every channel time series is a difference between an electrode and a reference. Change the reference and you change all of them (L2.3, pf-reference-changes-everything).

The mechanism is worth stating precisely, because it is not the same as the effect on a topography. Re-referencing subtracts a common signal r(t) from every channel. On a topography that is a constant shift and gradients survive. On a pair of channels it is a shared additive term — exactly the structure L5.1 showed produces coherence — so a reference that carries real signal injects a common component into every pair at once. A single noisy reference electrode can raise coherence across the entire montage; an average reference distributes a fraction of every channel into every other one.

L5.1’s own counterpoint figure carries the empirical version: on the same 19-channel eyes-closed recording, median alpha coherence for nearby pairs against distant pairs is 0.78 / 0.10 under the recording’s delivered reference and 0.56 / 0.38 under an average reference of those 19 channels. Same data, same estimator, same band; the pattern across distance has changed shape. Report the reference with every connectivity number, and prefer either a reference-free transform (L5.3) or a measure computed after source estimation (L5.6) when the claim rests on spatial structure.

What ICA cleaning does to connectivity

Removing ICA components and back-projecting is standard preprocessing (L2.6) and it has a consequence that matters here and almost nowhere else: the cleaned data has reduced rank. If you record 64 channels, fit 64 components and remove 5, the 64 returned channels are linear combinations of 59 underlying signals. Any measure that treats channels as independent observations is now working on a rank-deficient set, and measures of shared variance between channels are biased by that alone.

Two practical consequences. First, connectivity computed after aggressive component removal is not comparable with connectivity computed before it, and “we removed artifacts and the network changed” is not a finding. Second, the same rank problem compounds with interpolated bad channels (pf-interpolation-rank): an interpolated channel is, by construction, a weighted sum of its neighbours, so its coherence with them is partly an arithmetic identity. Exclude interpolated channels from connectivity analyses, or report which channels were interpolated in which subjects and what that does to the matrix. TODO(confirm): the size of the rank-deficiency bias on each of these measures should be checked against a primary source before publication; the site’s reading list does not cover it.

Directed measures, and the assumptions they carry

Symmetric measures say two channels are related. Directed measures claim to say which one drives the other.

  • Granger causality asks whether the past of y improves the prediction of x beyond what x’s own past provides. It is defined for a fitted model, usually a multivariate autoregressive one.
  • DTF (directed transfer function) and PDC (partial directed coherence) are frequency-domain quantities derived from the coefficients of a fitted MVAR model, differing in how they normalise the transfer matrix.

The assumptions are the whole story, and there are four:

  1. A model is being fitted. Order selection, stationarity over the fitted window, and sufficient data for the number of parameters (which grows as the square of the number of channels) are all choices that change the answer. A model that fits badly still produces a directed graph.
  2. Directionality is inferred from timing, and volume conduction has no timing. Instantaneous mixing therefore cannot, on its own, produce a directed result in the way it produces coherence — but it does change the estimated coefficients, and the interaction of mixing with unequal noise levels on the two channels can produce an apparent direction where there is none. Different signal-to-noise at two electrodes is the rule, not the exception.
  3. Missing sources create false edges. If a third region drives both and you did not record it, the pair will show a directed relationship determined by their relative delays. Sensor space always has missing sources.
  4. “Causality” is a name, not a claim. Granger causality is a statement about predictability in a fitted model. Nothing about an EEG dataset licenses the word “drives” in its ordinary sense.

TODO(confirm): the specific conditions under which asymmetric noise produces spurious directionality, and the recommended remedies, should be verified against a primary source; (Bastos, 2016) is the tutorial in the site’s reading list and the place to start.

Surrogate testing: build the null you actually need

A connectivity value has no interpretation without a null distribution, and L5.1 showed why the obvious null is wrong: the estimator’s floor for independent signals is 1/K, not zero, and the floor moves with segment count. Analytic nulls exist for some estimators under assumptions that rarely hold. The general tool is a surrogate: destroy one specific structure in the data, recompute the measure many times, and compare.

The art is choosing which structure to destroy, because that choice defines the hypothesis:

  • Phase randomization (randomize Fourier phases, keep the amplitude spectrum) destroys phase relationships while preserving each channel’s spectrum. It tests “is there any phase relationship beyond what these two spectra imply?”
  • Trial shuffling pairs channel i from one trial with channel j from another. It destroys within-trial coupling while preserving the task-locked structure of each channel, and so tests coupling beyond what both channels being time-locked to the same event already produces. For event-related designs this is usually the null you want.
  • Time shifting one channel by more than the longest interaction of interest destroys the coupling while preserving everything about each channel’s own dynamics. Its weakness is that a long shift also destroys slow non-stationary structure the two channels shared.
  • Block resampling preserves short-range autocorrelation and is the right choice when the measure is sensitive to it.

Two rules. Compute the surrogate through the entire pipeline, including any filtering, epoching and normalisation, or the null describes a different analysis than the one you ran. And a connectivity matrix is a multiple-comparisons problem — 21 channels give 210 pairs, 64 give 2016 — so the correction belongs with it. This is the same thread that runs through L3.7, L4.7 and L6.1: one test with a controlled family-wise error rate, not a matrix of uncorrected ones (pf-uncorrected-timepoint-tests).

Judgment call

Before computing any connectivity measure, write down the answer to: what would a positive result mean, and what could produce it other than the thing I want to claim? For sensor-space EEG the list of alternatives is long — one shared generator, a reference that carries signal, unequal noise, rank deficiency from cleaning, a common stimulus drive, muscle or ocular activity at the same frequency band in both channels — and every one of them produces exactly the pattern the measure was built to detect. Nothing in the analysis will rule them out for you.

The data behind this lesson

  • The notebook uses ds-lemon eyes-closed resting data. TODO(confirm): ds-lemon’s exact licence terms are recorded as unverified in the site’s catalogue, although both recorded statements are permissive; the entry should be confirmed before any derived asset ships.
  • No widget ships for this lesson. The simulator from L5.1 computes magnitude-squared coherence and the imaginary part of coherency only — not PLV, PLI or wPLI — so it can demonstrate the first two rows of the table above and no others. Use it for the mechanism and the notebook for the measures.
  • The one worked contrast available as shipped numbers is the simulator’s: two sources at the same frequency with a 90° phase difference and no noise give magnitude-squared coherence 1.0000 for every pair while the largest |imaginary coherency| on the montage reaches 0.9925; two independent narrowband sources with no noise give a mean coherence of 0.568, Fp1–O2 0.892, and a largest |imaginary coherency| of 0.102. Those two configurations are the difference this lesson is about, in one montage.

Practice

Sensor-space connectivity: coherence, imaginary coherence, PLV, PLI and wPLI from one set of Fourier coefficients on ds-lemon eyes-closed, with a surrogate null, the reference dependence, and Granger causality on a simulation where the answer is known nb-5-2-connectivity

Level 5 ~3 min
notebooks/L5/nb-5-2-connectivity.ipynb

Downloads from ds-lemon.

Open in Colab Download Read it here

The notebook computes coherence and wPLI matrices side by side on ds-lemon eyes-closed data with mne-connectivity, and adds the surrogate null for each so that the two matrices can be thresholded against the distribution their own estimator produces rather than against zero.

Exercises

Exercise ex-5-2-robust-to-what

Multiple select

Which statements about the weighted phase-lag index (wPLI) are true? Select all that apply.

Options (select all that apply)

Exercise ex-5-2-surrogate-choice

Multiple choice

In an event-related design, both channels respond to the stimulus, so both are time-locked to it. You want to test whether they are coupled beyond what that shared time-locking already produces. Which surrogate builds the right null?

Options

Exercise ex-5-2-disappears-under-wpli

Free response

You compute coherence and wPLI on the same eyes-closed resting data. One channel pair shows strong alpha coherence and a wPLI indistinguishable from its surrogate null. Which measure flagged a connection that disappeared, what are the candidate explanations, and what would you do next?

Pitfalls

Pitfall

Zero-lag connectivity from one source

Symptom
All sensors coherent; connectivity maps mirror power maps.
Cause

Volume conduction is instantaneous, linear mixing: every electrode sees a fixed weighted sum of every source, with real weights and no delay (L5.1). With a single generator, each sensor’s signal is xi(t) = ai · s(t) — one waveform times a real number. Take the Fourier transform of a segment and Xi = ai · S, so the coherence estimate is

Detect
  • Plot the independence floor on the same colour scale as the matrix. 1/K where K is the number of averaged segments. If the floor is visible next to the data, most of this pitfall becomes self-diagnosing. - Compare the connectivity map with the power map. If the “network” is wherever the band is strong, the null hypothesis is one generator, and it has not been tested. - Compute the imaginary par…
Fix
  • Report a measure that instantaneous mixing cannot manufacture: imaginary coherence, PLI or wPLI for phase, orthogonalized amplitude-envelope correlation for envelopes. State in the same sentence that these are blind to genuine zero-lag coupling, so that a null result is reported as uninformative about instantaneous interaction rather than as absence of connection. - Sharpen before measuring. Th…

Full entry with example →

Pitfall

Comparing amplitudes across references

Symptom
Component at Pz differs by half between studies.
Cause

An EEG channel is a difference: the potential at an electrode minus the potential at whatever the amplifier subtracted. There is no absolute voltage to recover. Changing the reference subtracts a different signal from every channel, so every amplitude changes, and by different amounts at different electrodes.

Detect
  • Read the methods of both studies for three things: the online reference, the offline reference, and, for an average, the number and layout of channels it was computed over. If any of the three is missing, the amplitudes are not comparable and you cannot make them so. - Re-reference your own data to the other study’s reference and repeat the measurement. That is the only honest comparison, and i…
Fix
  • Fix the reference before looking at the effect, and choose it from the component and the literature you need to speak to — not from which value looks best. - State all three facts in the methods: online reference, offline reference, and the channel set an average was taken over. - Reconstruct an absent online-reference channel (as a row of zeros with a montage position) before average-referenci…

Full entry with example →

In other tools

In other toolsEEGLAB · FieldTrip — names only

The equivalents of what this lesson does, for a reader who works in another toolbox. Function names only: their own documentation is the place to learn how to call them.

EEGLAB

  • newcrossfEEGLAB
  • pop_newcrossfEEGLAB

FieldTrip

  • ft_connectivityanalysisFieldTrip
  • ft_connectivityplotFieldTrip

Names checked 2026-09-18 against EEGLAB 2026.0.0 (plugins at the versions in EEGLAB’s own plugin list) and FieldTrip 20251218.

Reading

  1. Bastos & Schoffelen (2016). Connectivity tutorial review. unverified
  2. Vinck et al. (2011). wPLI. unverified
  3. Hipp et al. (2012). Orthogonalized envelopes. unverified