5D Library › Finger–Brain Cortical Magnification, Distal Microneedle Afference and Computational Neurology of Post-Stroke Cognitive Network Reconstruction · 中文

Chapter 5. Proposed Analyses: Microstates, the Phase Lag Index and Transfer Entropy

Note

The nature of this chapter. The EEG part of Lu Shunkang’s thesis did only power-spectral analysis; it did not analyse microstates, phase connectivity or information flow. The author’s framework proposes these methods to describe “cognitive network reconstruction”. This chapter is therefore written as a proposed analysis plan: what each method measures, its known traps in scalp EEG, and synthetic demonstrations of those traps. All connectivity values in the chapter come from signals generated by programs, not from any patient.

Volume conduction and the reference electrode

Every scalp electrode records the superposition of potentials from many cortical sources after spreading through the volume conductor of skull and scalp. This spread is practically instantaneous: one source appears at zero lag on several neighbouring electrodes at once (Nunez and Srinivasan 2006). Two neighbouring electrodes are highly correlated even without any interaction between independent neural sources. The choice of reference changes this correlation further: an average reference removes the component common to all electrodes, a linked-mastoid reference adds activity near the mastoids to every electrode. Bastos and Schoffelen (2016) called these problems “interpretational pitfalls” of functional connectivity analysis and recommended measures insensitive to zero-lag mixing, analysis in source space rather than electrode space, and tests against suitable surrogate data (Bastos and Schoffelen 2016).

Phase consistency and the phase lag index

The most common phase-connectivity measures are coherence and the phase-locking value (PLV), which measure whether the phase difference of two signals is stable. The trouble is that zero-lag mixing itself produces a stable phase difference (zero), so volume conduction inflates coherence and PLV. Nolte and colleagues (2004) proposed using only the imaginary part of the cross-spectrum, because pure zero-lag mixing produces none (Nolte et al. 2004); Stam, Nolte and Daffertshofer (2007) proposed the phase lag index (PLI): the absolute value of the mean sign of the phase difference, so that zero or 180° lags contribute nothing (Stam et al. 2007); the weighted PLI (wPLI) of Vinck and colleagues (2011) weights by the size of the imaginary part and reduces bias from noise and small samples (Vinck et al. 2011).

The program below generates two 10-Hz sources in four cases: independent sources, unmixed; independent sources mixed at zero lag with weight 0.6; source 2 driven by source 1 with a 12-ms lag, unmixed; and the same drive with mixing.

Calculation

# Chapter 5. Volume conduction and phase connectivity on synthetic data. Two 10-Hz
# AR(2) sources (fs 250 Hz); sensors x1 = s1 + m s2 + noise, x2 = m s1 + s2 + noise
# (m = zero-lag mixing). Phases by complex demodulation (100-ms moving average).
# Coherence, PLV, imaginary coherence, PLI (Stam et al. 2007), wPLI (Vinck et al. 2011).
# Cases: A independent, m = 0; B independent, m = 0.6; C s2 driven by s1 with a 12-ms
# lag, m = 0; D the same drive, m = 0.6.
import math, random, cmath

FS, F0, N, L = 250.0, 10.0, 30000, 25

def ar2(rng, n, drive=None, lag=3, k=0.5):
    a1, a2 = 2 * 0.97 * math.cos(2 * math.pi * F0 / FS), -0.97 ** 2
    x = [0.0, 0.0]
    for t in range(2, n + 2):
        v = a1 * x[-1] + a2 * x[-2] + rng.gauss(0, 1)
        if drive is not None and t - 2 - lag >= 0:
            v += k * drive[t - 2 - lag]
        x.append(v)
    return x[2:]

def demod(x):
    z = [x[t] * cmath.exp(-2j * math.pi * F0 * t / FS) for t in range(len(x))]
    c, out = [0j], []
    for v in z:
        c.append(c[-1] + v)
    return [(c[t + L] - c[t]) / L for t in range(len(z) - L)]

def measures(x1, x2):
    z1, z2 = demod(x1), demod(x2)
    cr = [a * b.conjugate() for a, b in zip(z1, z2)]
    n = len(cr)
    p1 = math.fsum(abs(a) ** 2 for a in z1) / n
    p2 = math.fsum(abs(b) ** 2 for b in z2) / n
    mre = math.fsum(c.real for c in cr) / n; mim = math.fsum(c.imag for c in cr) / n
    coh = abs(complex(mre, mim)) / math.sqrt(p1 * p2)
    icoh = abs(mim) / math.sqrt(p1 * p2)
    u = [c / abs(c) for c in cr if abs(c) > 0]
    plv = abs(complex(math.fsum(c.real for c in u),
                      math.fsum(c.imag for c in u))) / len(u)
    pli = abs(math.fsum(math.copysign(1.0, c.imag) for c in cr if c.imag != 0)) / n
    wpli = abs(mim) / (math.fsum(abs(c.imag) for c in cr) / n)
    return coh, plv, icoh, pli, wpli

if __name__ == "__main__":
    rng = random.Random(2007)
    print("case                          coherence   PLV   imag.coh    PLI   wPLI")
    for lab, coupled, m in (("A independent, m = 0", False, 0.0),
                            ("B independent, m = 0.6", False, 0.6),
                            ("C 12-ms lagged drive, m = 0", True, 0.0),
                            ("D 12-ms lagged drive, m = 0.6", True, 0.6)):
        s1 = ar2(rng, N)
        s2 = ar2(rng, N, drive=s1 if coupled else None)
        sd = math.sqrt(math.fsum(v * v for v in s1) / N)
        x1 = [a + m * b + rng.gauss(0, 0.3 * sd) for a, b in zip(s1, s2)]
        x2 = [m * a + b + rng.gauss(0, 0.3 * sd) for a, b in zip(s1, s2)]
        r = measures(x1, x2)
        print(f"{lab:30s}" + "".join(f"{v:9.3f}" for v in r))
    print(f"12 ms at 10 Hz is a phase lag of {360 * F0 * 0.012:.0f} degrees")
# case                          coherence   PLV   imag.coh    PLI   wPLI
# A independent, m = 0              0.035    0.014    0.034    0.019    0.069
# B independent, m = 0.6            0.868    0.788    0.019    0.031    0.077
# C 12-ms lagged drive, m = 0       0.746    0.644    0.718    0.730    0.949
# D 12-ms lagged drive, m = 0.6     1.000    0.998    0.029    0.713    0.947
# 12 ms at 10 Hz is a phase lag of 43 degrees

Case B is the key: the two sources are completely independent, yet zero-lag mixing alone gives a coherence of 0.868 and a PLV of 0.788, while the imaginary coherence (0.019), PLI (0.031) and wPLI (0.077) are similar to the independent, unmixed case A. In case C a genuine 12-ms (about 43°) coupling delay exists (after the AR(2) resonance the measured phase difference between electrodes is larger), and every measure rises, wPLI to 0.949. Case D shows the other side: mixing pushes the imaginary coherence down to 0.029, because mixing greatly increases the real part and the total power, while PLI and wPLI stay at 0.71 and 0.95. So in scalp EEG “higher coherence” cannot be read as “stronger network connections”; PLI and wPLI are robust to zero-lag mixing, but they also miss genuinely zero-lag interactions.

Transfer entropy

Transfer entropy measures how much information the past of XX adds to predicting the next value of YY, given YY’s own past (Schreiber 2000). Being model-free, it is used as a measure of “effective connectivity” (Vicente et al. 2011). Its traps again come from observation: unobserved common drivers, zero-lag mixing, and too coarse a description (embedding) of the past.

Calculation

# Chapter 5. Transfer entropy (Schreiber 2000) on synthetic series coded into 3 equal
# bins, one step of history; 30 surrogates shift X circularly. Cases (N = 15,000):
# 1 X drives Y with a one-step delay; 2 independent; 3 a hidden Z drives X after 1 step
# and Y after 2 (no X-Y link); 4 independent X, Y seen through zero-lag mixing.
import math, random

N, NSUR = 15000, 30

def code(v):
    s = sorted(v); a, b = s[len(v) // 3], s[2 * len(v) // 3]
    return [0 if u < a else (1 if u < b else 2) for u in v]

def te(x, y):
    c3, c2a, c2b, c1 = {}, {}, {}, {}
    for t in range(len(y) - 1):
        k3 = (y[t + 1], y[t], x[t]); c3[k3] = c3.get(k3, 0) + 1
        ka = (y[t], x[t]); c2a[ka] = c2a.get(ka, 0) + 1
        kb = (y[t + 1], y[t]); c2b[kb] = c2b.get(kb, 0) + 1
        c1[y[t]] = c1.get(y[t], 0) + 1
    n = len(y) - 1
    return math.fsum(
        c / n * math.log2(c * c1[k[1]] / (c2a[(k[1], k[2])] * c2b[(k[0], k[1])]))
        for k, c in c3.items())

def series(rng, case):
    x, y, z = [0.0], [0.0], [0.0, 0.0]
    for t in range(1, N + 50):
        z.append(0.5 * z[-1] + rng.gauss(0, 1))
        if case == 1:
            x.append(0.6 * x[-1] + rng.gauss(0, 1))
            y.append(0.5 * y[-1] + 0.4 * x[-2] + rng.gauss(0, 1))
        elif case == 3:
            x.append(0.5 * x[-1] + 0.8 * z[-2] + rng.gauss(0, 1))
            y.append(0.5 * y[-1] + 0.8 * z[-3] + rng.gauss(0, 1))
        else:
            x.append(0.6 * x[-1] + rng.gauss(0, 1))
            y.append(0.6 * y[-1] + rng.gauss(0, 1))
    x, y = x[50:], y[50:]
    if case == 4:
        x, y = [a + 0.5 * b for a, b in zip(x, y)], [b + 0.5 * a for a, b in zip(x, y)]
    return code(x), code(y)

def test(rng, x, y):
    obs = te(x, y); sur = []
    for _ in range(NSUR):
        k = rng.randrange(200, len(x) - 200)
        sur.append(te(x[k:] + x[:k], y))
    return obs, max(sur)

if __name__ == "__main__":
    rng = random.Random(2000)
    print("case (bits)                       TE X->Y (max surr.)   TE Y->X (max surr.)")
    for case, lab in ((1, "1 X drives Y"), (2, "2 independent"),
                      (3, "3 hidden common driver"), (4, "4 zero-lag mixing")):
        x, y = series(rng, case)
        a, sa = test(rng, x, y); b, sb = test(rng, y, x)
        fa = "*" if a > sa else " "; fb = "*" if b > sb else " "
        print(f"{lab:32s} {a:.4f}{fa} ({sa:.4f})      {b:.4f}{fb} ({sb:.4f})")
    print("* = above every surrogate (p < 1/31)")
# case (bits)                       TE X->Y (max surr.)   TE Y->X (max surr.)
# 1 X drives Y                     0.0933* (0.0013)      0.0022* (0.0016)
# 2 independent                    0.0003  (0.0013)      0.0004  (0.0010)
# 3 hidden common driver           0.0886* (0.0013)      0.0031* (0.0009)
# 4 zero-lag mixing                0.0064* (0.0011)      0.0068* (0.0012)
# * = above every surrogate (p < 1/31)

In case 1, XX drives YY and the transfer entropy is 0.0933 bits, far above the largest surrogate value; but the reverse direction Y→XY \to X also gives 0.0022 bits, slightly above the surrogates (0.0016). This comes from too coarse an embedding: with three bins per series and one step of past, XX’s own past is not fully captured, so old information about XX carried in YY is misread as “reverse information flow”. In case 3 there is no link between XX and YY; an unobserved ZZ drives XX first and YY later, yet the transfer entropy X→YX \to Y reaches 0.0886 bits, almost as large as a real drive. In case 4, two independent series observed only through zero-lag mixing give “significant” transfer entropy in both directions.

All three points matter for stroke EEG. Diffuse modulatory systems of the thalamus and brainstem are typical common drivers; mixing between scalp electrodes is unavoidable; and estimating high-dimensional conditional distributions from 5-minute resting recordings means that the choice of embedding dimension and binning changes conclusions. Transfer entropy is suitable only as an exploratory analysis in source space, tested against surrogates, with embedding parameters fixed in advance.

Microstates

EEG microstate analysis treats the scalp potential distribution of multichannel EEG as a sequence of briefly stable “maps”, each lasting tens to a little over a hundred milliseconds; maps are usually sampled at peaks of global field power and clustered by a modified k-means algorithm into 4 to 7 classes (often labelled A–D), from which the mean duration, occurrence, coverage and transition probabilities of each class are computed (Michel and Koenig 2018). It uses the spatial information of all electrodes and does not depend on the reference; but the number of classes must be chosen, map polarity is usually ignored, class labels may not correspond to the same sources across studies, and eyes open or closed and drowsiness change the parameters strongly. The thesis cites a study comparing resting microstates in different cognitive disorders (reference 57 of the thesis) but did not perform this analysis on its own data.

Proposed analysis plan

If the trial of Chapter 8 records EEG, the following plan should be published with the registered protocol and carried out by analysts unaware of allocation:

Item Specification
Timing Baseline and week 4, each at a fixed time of day; not during stimulation or within minutes after it, so that immediate arousal changes are not taken as treatment effects
States 5 minutes eyes closed and 5 minutes eyes open, in fixed order; analysed separately, with no cross-state comparison
Preprocessing Pre-specified filtering, bad-channel interpolation, independent-component rejection criteria and average reference; processing scripts and version numbers published
Main EEG measure Eyes-closed frontal (pre-specified electrodes) 8–13 Hz relative power and individual alpha peak frequency, the pre-specified mediator of Chapter 8
Connectivity Alpha-band wPLI, for a few pre-specified pairs of regions, computed in source space; whenever coherence is reported, imaginary coherence is reported too
Exploratory Microstates (number of classes fixed at 4) and transfer entropy (source space, surrogate tests); results clearly labelled exploratory
Not done Picking “significant” results from 64 electrodes, several bands and several measures; treating one participant’s spectrum as a group result

Chapter summary

The thesis did no connectivity analysis, so this chapter only proposes a plan. Synthetic data show that zero-lag mixing alone can push the coherence of two independent sources to 0.87 while PLI and wPLI are unaffected; a genuine 12-ms lagged drive raises wPLI to 0.95. Transfer entropy can be misled by unobserved common drivers, zero-lag mixing and too coarse an embedding: a hidden driver produces “information flow” almost as large as a real drive. Microstates use the spatial information of all electrodes, but the number of classes and the state (eyes open or closed, drowsiness) change conclusions. Any connectivity measure should be fixed in advance, computed in source space and tested against surrogates; none can by itself prove “cognitive network reconstruction”.

References

Bastos, André M., and Jan-Mathijs Schoffelen. 2016. “A Tutorial Review of Functional Connectivity Analysis Methods and Their Interpretational Pitfalls.” Frontiers in Systems Neuroscience 9: 175. https://doi.org/10.3389/fnsys.2015.00175.
Michel, Christoph M., and Thomas Koenig. 2018. “EEG Microstates as a Tool for Studying the Temporal Dynamics of Whole-Brain Neuronal Networks: A Review.” NeuroImage 180: 577–93. https://doi.org/10.1016/j.neuroimage.2017.11.062.
Nolte, Guido, Ou Bai, Lewis Wheaton, Zoltan Mari, Sherry Vorbach, and Mark Hallett. 2004. “Identifying True Brain Interaction from EEG Data Using the Imaginary Part of Coherency.” Clinical Neurophysiology 115 (10): 2292–307. https://doi.org/10.1016/j.clinph.2004.04.029.
Nunez, Paul L., and Ramesh Srinivasan. 2006. Electric Fields of the Brain: The Neurophysics of EEG. 2nd ed. Oxford University Press.
Schreiber, Thomas. 2000. “Measuring Information Transfer.” Physical Review Letters 85 (2): 461–64. https://doi.org/10.1103/PhysRevLett.85.461.
Stam, Cornelis J., Guido Nolte, and Andreas Daffertshofer. 2007. “Phase Lag Index: Assessment of Functional Connectivity from Multi Channel EEG and MEG with Diminished Bias from Common Sources.” Human Brain Mapping 28 (11): 1178–93. https://doi.org/10.1002/hbm.20346.
Vicente, Raul, Michael Wibral, Michael Lindner, and Gordon Pipa. 2011. “Transfer Entropy—a Model-Free Measure of Effective Connectivity for the Neurosciences.” Journal of Computational Neuroscience 30 (1): 45–67. https://doi.org/10.1007/s10827-010-0262-3.
Vinck, Martin, Robert Oostenveld, Marijn van Wingerden, Francesco Battaglia, and Cyriel M. A. Pennartz. 2011. “An Improved Index of Phase-Synchronization for Electrophysiological Data in the Presence of Volume-Conduction, Noise and Sample-Size Bias.” NeuroImage 55 (4): 1548–65. https://doi.org/10.1016/j.neuroimage.2011.01.055.

Fan, Y. (2026). Finger–Brain Cortical Magnification, Distal Microneedle Afference and Computational Neurology of Post-Stroke Cognitive Network Reconstruction: From Complex-Network Pinning Control and Thalamocortical 10 Hz Alpha Restoration to Drift-Diffusion Models, Read Beside the Twelve Jing-Well Points of the Lingshu [指—脑皮层放大、远端微针传入与卒中后认知网络重建的计算神经学] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23839915 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).