Generalized filtering is a generic Bayesian filtering scheme for nonlinear state-space models. It is based on a variational principle of least action, formulated in generalized coordinates of motion. Generalized filtering furnishes posterior densities over hidden states (and parameters) generating observed data using a generalized gradient descent on variational free energy, under the Laplace assumption. Unlike classical (e.g., Kalman-Bucy or particle) filtering, generalized filtering eschews Markovian assumptions about random fluctuations. Furthermore, it operates online, assimilating data to approximate the posterior density over unknown quantities, without the need for a backward pass. Special cases include variational filtering, dynamic expectation maximization and generalized predictive coding.
Contents
- Definition
- Generalized filtering
- Variational basis
- Generative state space models in generalized coordinates
- Filtering discrete time series
- Generalized filtering and model parameters
- Generalized filtering and Kalman filtering
- Generalized filtering and particle filtering
- Generalized filtering and variational Bayes
- Generalized filtering and predictive coding
- Applications
- References
Definition
Definition: Generalized filtering rests on the tuple
Here ~ denotes a variable in generalized coordinates of motion:
Generalized filtering
The objective is to approximate the posterior density over hidden and control states, given sensor states and a generative model – and estimate the (path integral of) model evidence
Denote the Shannon entropy of the density
The second equality shows that minimizing variational free energy (i) minimizes the Kullback-Leibler divergence between the variational and true posterior density and (ii) renders the variational free energy (a bound approximation to) the negative log evidence (because the divergence can never be less than zero). Under the Laplace assumption
The variational means that minimize the (path integral) of free energy can now be recovered by solving the generalized filter:
where,
Variational basis
Generalized filtering is based on the following lemma: The self-consistent solution to
Proof: self-consistency requires the motion of the mean to be the mean of the motion and (by the fundamental lemma of variational calculus)
Put simply, small perturbations to the path of the mean do not change variational free energy and it has the least action of all possible (local) paths.
Remarks: Heuristically, generalized filtering performs a gradient descent on variational free energy in a moving frame of reference:
In practice, generalized filtering uses local linearization over intervals
This updates the means of hidden variables at each interval (usually the interval between observations).
Generative (state-space) models in generalized coordinates
Usually, the generative density or model is specified in terms of a nonlinear input-state-output model with continuous nonlinear functions:
The corresponding generalized model (under local linearity assumptions) obtains the from the chain rule
Gaussian assumptions about the random fluctuations
The covariances
Here,
Filtering discrete time series
When time series are observed as a discrete sequence of
In principle, the entire sequence could be used to estimate hidden variables at each point in time. However, the precision of samples in the past and future falls quickly and can be ignored. This allows the scheme to assimilate data online, using local observations around each time point (typically between two and eight).
Generalized filtering and model parameters
For any slowly varying model parameters of the equations of motion
Here, the solution
Generalized filtering and Kalman filtering
Classical filtering under Markovian or Wiener assumptions is equivalent to assuming the precision of the motion of random fluctuations is zero. In this limiting case, one only has to consider the states and their first derivative
Substituting this first-order filtering into the discrete update scheme above gives the equivalent of (extended) Kalman filtering.
Generalized filtering and particle filtering
Particle filtering is a sampling-based scheme that relaxes assumptions about the form of the variational or approximate posterior density. The corresponding generalized filtering scheme is called variational filtering. In variational filtering, an ensemble of particles diffuse over the free energy landscape in a frame of reference that moves with the expected (generalized) motion of the ensemble. This provides a relatively simple scheme that eschews Gaussian (unimodal) assumptions. Unlike particle filtering it does not require proposal densities—or the elimination or creation of particles.
Generalized filtering and variational Bayes
Variational Bayes rests on a mean field partition of the variational density:
This partition induces a variational update or step for each marginal density—that is usually solved analytically using conjugate priors. In generalized filtering, this leads to dynamic expectation maximisation. that comprises a D-step that optimizes the sufficient statistics of unknown states, an E-step for parameters and an M-step for precisions.
Generalized filtering and predictive coding
Generalized filtering is usually used to invert hierarchical models of the following form
The ensuing generalized gradient descent on free energy can then be expressed compactly in terms of prediction errors, where (omitting high order terms):
Here,
Applications
Generalized filtering has been primarily applied to biological timeseries—in particular functional magnetic resonance imaging and electrophysiological data. This is usually in the context of dynamic causal modelling to make inferences about the underlying architectures of (neuronal) systems generating data. It is also used to simulate inference in terms of generalized (hierarchical) predictive coding in the brain.