JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

State-Space Models: The Probabilistic Backbone

Before the deep learning, the field earned its intuitions on linear-Gaussian and point-process latent variable models — and those models are still the honest baseline every fancier method must beat.

The latent linear dynamical system

You met the state-space model in Volume II as an estimation tool — with the dynamics matrix and observation matrix given, run a Kalman filter to track the state. The frontier flips the problem: the parameters are unknown, and the whole point is to learn the dynamics from data. That reframing — from filtering a known system to identifying an unknown one — is the essence of data-driven system identification.

A latent state-space model: unobserved low-dimensional state evolves under learned dynamics and generates the observed spikes through an emission model. Learning means recovering both the state path and the dynamics.

x_{t+1} = A\,x_{t} + B\,u_{t} + w_{t}, \;\; w_{t}\sim\mathcal{N}(0,Q); \qquad y_{t}\mid x_{t} \sim \mathrm{Poisson}\!\bigl(\exp(C\,x_{t}+d)\bigr)

A latent linear dynamical system with a point-process readout. A is the dynamics, C the loadings, and spike counts yₜ are Poisson with a log-linear rate. Unlike the Vol II Kalman filter, here A, B, C, Q are all learned.

The Poisson-log-linear readout matters: spikes are counts, not Gaussian voltages, so the clean linear-Gaussian Kalman recursion no longer closes in exact form. This single change — a non-conjugate observation model — is what forces the field toward the approximate-inference machinery in the rest of this guide.

Learning the model

With parameters unknown, fitting alternates between two jobs: infer the latent path given current parameters, then update parameters given the inferred path. That is expectation-maximization — an E-step of Bayesian smoothing (an RTS smoother in the linear-Gaussian case, or a point-process filter with spikes) and an M-step of maximum-likelihood parameter updates. It is the classical, interpretable workhorse.

For the non-Gaussian case, exact smoothing is intractable, so modern fits use variational inference: posit a tractable approximate posterior over the latent path and push it toward the true posterior by maximizing a lower bound on the data likelihood. This variational treatment of neural dynamics is the bridge from the classical LDS to the deep models of the next guide — both optimize the same objective.

\log p(y) \;\ge\; \mathbb{E}_{q(x\mid y)}\!\bigl[\log p(y\mid x)\bigr] \;-\; \mathrm{KL}\!\bigl(q(x\mid y)\,\|\,p(x)\bigr) \;=\; \mathcal{L}_{\mathrm{ELBO}}

The evidence lower bound. The first term rewards reconstructing the spikes from the inferred latent; the KL term keeps the approximate posterior close to the dynamical prior p(x). Maximizing it fits both the state and the model.

Dynamics-agnostic smoothing: GPFA

Sometimes you do not want to commit to a parametric dynamics matrix at all — you just want smooth, denoised trajectories to look at. Gaussian-process factor analysis (GPFA) does exactly this: instead of a matrix A, it places a Gaussian-process prior on each latent dimension, encoding smoothness through a timescale rather than an explicit flow. It remains a favourite first pass for visualizing population structure precisely because it imposes so little.

k(t, t') = \sigma^{2}\,\exp\!\left(-\frac{(t-t')^{2}}{2\,\tau^{2}}\right)

GPFA's squared-exponential kernel: the timescale τ sets how quickly a latent may change, and σ² its scale. Correlations in time replace an explicit dynamics equation — smoothness without a mechanistic commitment.

From LDS to sequential VAEs

A single linear system is often too rigid — real neural dynamics are nonlinear. The modern move keeps the state-space skeleton but lets a neural network parameterize the pieces, trained end-to-end as a sequential variational autoencoder (seq-VAE): an encoder infers a distribution over the latent path, a learned generator rolls it forward, and the ELBO you just met is the loss. This is the exact template the celebrated LFADS model fills in — and the subject of the next guide.