How can PCA-based neural trajectory analysis be applied to human EEG and MEG?

A primer showing how PCA turns EEG and MEG sensor patterns into low-dimensional trajectories, with decoding benchmarks and caveats.

Direct answer

PCA-based trajectory analysis treats each moment of EEG or MEG activity as a point in a high-dimensional state space, then projects those points onto a few orthogonal axes ordered by explained covariance so that their time-ordered path can be visualized and measured. The paper's worked examples show this is a practical route into population-level thinking for human electrophysiology, but its decoding value depends on how the state space is built: a shared PCA space matched sensor space almost exactly, while participant-aligned PCA decoded better early and explicit trajectory descriptors alone performed worse.

1sources cited

This article was generated with WisPaper-powered search and paper analysis.

From channel averages to moving neural states

The paper's starting observation is that mainstream EEG and MEG analysis usually summarizes data channel by channel, as scalp maps, oscillatory power, or event-related potentials. Each of those leaves the joint pattern across sensors largely unexamined. The primer proposes a different reading: at every time point within a trial, the sensors simultaneously sample one pattern of activity, and that pattern is a single neural state in a high-dimensional sensor space. As time advances, the state moves, and the succession of states traces a trajectory.

This reframing matters because it makes a specific class of question askable. Instead of asking whether one channel or one frequency band differs between conditions, a researcher can ask whether condition-specific trajectories separate, converge, bend, or travel farther through the same space. The paper is explicit that this is a conceptual and practical guide rather than a new empirical theory of cognition: it aims to make state-space thinking usable for cognitive neuroscientists who already work with rich multichannel recordings but are unfamiliar with population-dynamics methods.

PCA supplies axes, not yet trajectories

Principal Component Analysis identifies orthogonal directions in the original feature space along which the data covary most. The first component explains the greatest variance, the second the next greatest, and so on. Projecting each observation onto a chosen number of these components produces scores in a reduced space. The paper stresses a detail that is easy to miss: PCA itself is agnostic to the temporal order of observations. Time structure is reintroduced only when the projected scores are ordered in time and connected into a path.

That distinction separates two decisions that readers often conflate. PCA defines the coordinate system; trajectory analysis defines how movement through that system is visualized, summarized, and tested. The paper's ten-step workflow runs from defining the neural representation, through preprocessing and reshaping into an observation-by-feature matrix, to fitting PCA, selecting components, projecting, inspecting loadings, plotting and quantifying geometry, relating metrics to behavior, and validating. Component loadings can be inspected as scalp topographies when features are sensors, though the overall sign of a component is arbitrary.

Shared, per-subject, and aligned spaces differ

The paper treats the choice of where to fit PCA as a substantive analytic decision rather than a technicality. PCA can be fit within a subject, within a condition, at the group level, within a task epoch, or within a region or network. When it is fit separately for each subject or condition, the resulting axes are estimated independently and are not directly comparable across participants or conditions. That is acceptable for characterizing within-subject dynamics but blocks direct comparison of trajectory geometry across datasets.

Fitting at the group level places all subjects and conditions in a common coordinate system, at the cost of possibly obscuring individual-specific structure. The paper states the rule plainly: direct comparisons between conditions, subjects, or groups require a shared PC space. It also notes that for decoding or cross-validation, PCA should be fit only on training data, and that the number of retained components should be justified by variance accounted for, component stability, interpretability, and the robustness of downstream metrics. Lower-variance components should not be discarded automatically, because behaviorally relevant information can sit outside the first few.

Speed and curvature carry no fixed meaning

Once trajectories exist, the paper catalogs metrics that describe them. Speed, or state-space velocity, measures how quickly the projected state changes between successive points. Curvature describes how sharply the path bends. Path length totals the distance traveled across a trial, condition, or epoch. Separation measures how far apart condition-specific trajectories are, while convergence and divergence describe movement toward common or distinct regions. Subspace overlap, alignment, and dimensionality estimates test whether conditions or groups rely on similar low-dimensional structure.

The paper is careful about interpretation. No trajectory metric has intrinsic cognitive meaning; a bend, loop, separation, or attractor-like pattern becomes interpretable only when linked to task timing, behavior, component structure, robustness analyses, or computational models. It offers candidate uses rather than conclusions: speed may be relevant to reaction time or rapid state transitions, separation to category differentiation or decision formation, curvature to nonlinear transitions between task phases, and dimensionality to task complexity or clinical variability. These are hypotheses the metrics can serve, not findings the paper establishes.

Motor imagery and face decoding as demonstrations

The EEG example uses motor execution and imagery conditions, presented with a tutorial notebook that walks from conventional EEG summaries to trajectory-based analysis. The MEG example uses a face-perception dataset. In the MEG analysis, the authors built a shared broadband state space, then separately computed 8–12 Hz alpha power with a Hilbert transform and projected those data into their own separately fitted PC space. The resulting trajectories differed from the broadband ones, which the paper presents as the point: changing which variables define the neural state changes the geometry of the trajectory while the framework stays the same.

The decoding comparison is the most concrete quantitative result. Using a sliding-window classifier with leave-one-participant-out cross-validation across 16 participants, the authors compared three representations of each trial: the 36 whitened sensors, the shared PC state space, and a set of explicit trajectory descriptors such as speed, jerk, cumulative path length, distance from centroid, turning angle, and area under the speed curve. In the early post-stimulus interval, balanced accuracy reached 0.417 for sensors and 0.418 for shared PCA in a three-class problem with chance at 0.333, and 0.616 versus 0.634 for unfamiliar versus scrambled stimuli with chance at 0.500. The paper's reading is that the dimensionality reduction is essentially free, neither buying nor losing prediction accuracy.

Aligned spaces beat sensors; descriptors lag behind

The authors then tested whether aligning state spaces across participants would help. In aligned PCA, each participant gets an individually fitted PCA space rather than contributing to a shared one; within each cross-validation fold, trials are averaged across conditions per training participant to obtain a condition-agnostic mean trajectory, these are averaged into a common template, and each participant's mean trajectory is Procrustes-rotated onto that template. With 22 components, aligned PCA reached 0.435 in the three-class classification and 0.648 for unfamiliar versus scrambled stimuli, outperforming the sensor-space baseline in both cases, with both peaking near 156 ms, close to the expected M170 latency.

Concatenating trajectory descriptors onto the aligned component scores gave the best configurations: 0.444 in the three-class task with 22 components plus path length, displacement, and area under the speed curve, and 0.652 for unfamiliar versus scrambled stimuli with 22 components plus jerk, path length, and area under the speed curve. Descriptors alone were clearly worse, at 0.388 and 0.574. The authors label this an exploratory analysis, and the pattern is specific: participant-specific spaces mapped into a common coordinate system decoded better early than either sensor space or shared PCA, while explicit trajectory descriptors performed poorly alone and added no reliable benefit when combined with PCA.

Linear variance limits and EEG-specific pitfalls

The paper is candid about what PCA cannot do. It is linear and variance-driven: components capture dominant covariance structure, not necessarily the biological variables a researcher hopes to find, which is why the authors prefer the terms PCA space or low-dimensional state space over latent space. EEG and MEG add their own difficulties. Spatial mixing means sensor-level patterns blend sources, preprocessing choices can reshape the geometry, and validation is needed because plausible-looking trajectories can arise from noise or analytic flexibility. Overinterpretation is named as a distinct risk.

The recommended safeguards follow from those limits rather than standing apart from them. The workflow calls for evaluating robustness with alternative preprocessing choices, different PCA spaces or values of the retained component count, alternative trajectory metrics, cross-validation, and appropriate statistical testing. The paper also situates PCA within a broader family of state-space methods, and one companion notebook compares PCA with UMAP, PHATE, and Isomap on the same observations, so PCA is presented as an accessible entry point rather than the final word.

Start with a shared space, then test alignment

For a researcher deciding how to begin, the paper's own comparisons set a clear order of priorities. A shared PCA space is the minimum requirement for comparing conditions, subjects, or groups, and in the MEG example it matched sensor-space decoding almost exactly while reducing dimensionality. That makes it a low-risk first step: it does not cost predictive accuracy, and it produces interpretable loadings and geometry. Explicit trajectory descriptors should not be relied on as a standalone representation, since they decoded at 0.388 and 0.574 against 0.417 and 0.616 for raw sensors in the same early window.

The step that actually improved early decoding was participant-level alignment into a common template, reaching 0.435 and 0.648 with 22 components, with descriptors adding a small further gain only when concatenated onto aligned scores. The paper frames this as exploratory, so the defensible reading is conditional: alignment is worth testing when between-participant comparison is the goal, and any trajectory metric should be tied to task timing, behavior, or component structure before it is given a cognitive interpretation. The primer's contribution is that ordering of choices, not a claim that trajectories decode cognition better than established methods.

Sources used in this answer

1

From Signals to Trajectories: A Primer on Low-Dimensional Dynamics in Human EEG and MEG

A PCA-based primer that turns EEG/MEG sensor patterns into low-dimensional state-space trajectories; in worked examples, shared PCA matched sensor-space decoding, participant-aligned PCA decoded better early, and trajectory descriptors alone performed worse.