Research Note: Markov-Switching State-Space Models for Neural Decoding
Published:
This note documents a direction explored in my weekly reports: using Markov-switching state-space models (SSMs) as a controllable alternative to heavy end-to-end deep pipelines for neural decoding tasks.
Motivation
Three practical constraints motivate this direction:
- training cost can be high in large neural decoders,
- throughput can be limited for rapid experimentation,
- cross-dataset benchmarking needs models with transparent assumptions.
Base SSM
A standard linear SSM writes:
\[\dot{x}(t)=A(t)x(t)+B(t)u(t),\qquad y(t)=C(t)x(t)+D(t)u(t).\]In discrete form (VAR-style latent dynamics):
\[y_t=Cx_t+w_t,\qquad x_t=\sum_{i=1}^p A_i x_{t-i}+v_t.\]Regime Switching Extension
With latent regime \(S_t\), both transition and observation structure can switch:
\[y_t=C_{S_t}x_{t,S_t}+w_t,\qquad x_{t,j}=\sum_{i=1}^p A_{i,j}x_{t-i,j}+v_{t,j},\;1\le j\le M.\]Interpretation:
- each regime has its own linear dynamics,
- regime transitions are Markovian,
- observations are generated by the currently active regime.
Note the index \(j\) on the latent state. All \(M\) chains advance at every step, whichever regime is active. The regime \(S_t\) only selects which chain reaches the sensors, and through which \(C_j\). The figure runs a toy version with \(M = 2\).
- 1Regime\(\Pr(S_t = j \mid S_{t-1} = j) = \pi_{jj}\)Now St = 1, for the last 1 sample.
Switches among the N = 240 samples in view: 0 (expected (N − 1)(1 − πjj) = 4.8). - 2All M = 2 chains runSLDS: one chain, switched dynamics\(x_{t,j} = A_{1,j}x_{t-1,j} + A_{2,j}x_{t-2,j} + v_{t,j}\)\(x_t = A_{1,S_t}x_{t-1} + A_{2,S_t}x_{t-2} + v_t\)Poles rje±i2πfj, with fj in cycles/sample. σv,j gives each chain variance 1.σv,j would give regime j’s chain variance 1 if it ran alone, but the switched state xt is not held there. Its long-run variance at this πjj is –. In view: – samples beyond the panel’s ±3.5, largest |xt| = –.
j rj fj A1,j A2,j σv,j 1 2 - 3Observation\(y_t = C_{S_t}x_{t,S_t} + w_t\)\(y_t = C_{S_t}x_t + w_t\)C1 = , C2 =
wt ~ N(0, σw2I), σw = 0.20
Why This Is Useful for EEG/MEG
Neural recordings are often non-stationary across time, subject condition, and device context. Regime switching gives a principled way to model piecewise-stable dynamics without forcing a single global linear model.
Current Practical Goals
- Reduce computational cost compared with heavier baselines.
- Maintain competitive decoding quality on open EEG/MEG benchmarks.
- Improve interpretability by exposing regime-specific dynamics.
This is still a working direction, but it has strong potential as a bridge between statistical rigor and deployment-friendly decoding.
