ArticleslgStudy

biology

Generalized filtering

Generalized filtering is a biology topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Generalized filtering rather than just read about it. In short: 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.

Key takeaways

  • Generalized filtering belongs to biology; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Generalized filtering to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Generalized filtering from memory before moving on to harder problems.

Reference excerpt

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. Note that "generalized coordinates of motion" are related to—but distinct from—generalized coordinates as used in (multibody) dynamical systems analysis. 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.

Definition Definition: Generalized filtering rests on the tuple (Ω,U,X,S,p,q):

A sample space Ω from which random fluctuations ω∈Ω are drawn Control states U∈ℝ – that act as external causes, input or forcing terms Hidden states X:X×U×Ω→ℝ – that cause sensory states and depend on control states Sensor states S:X×U×Ω→ℝ – a probabilistic mapping from hidden and control states Generative density p(s~,x~,u~∣m) – over sensory, hidden and control states under a generative model m Variational density q(x~,u~∣μ~) – over hidden and control states with mean μ~∈ℝ Here ~ denotes a variable in generalized coordinates of motion: u~=[u,u′,u″,…]T

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 p(s~(t)|m) to compare different models. This generally involves an intractable marginalization over hidden states, so model evidence (or marginal likelihood) is replaced with a variational free energy bound. Given the following definitions:

μ~(t)=argminμ~{F(s~(t),μ~)} G(s~,x~,u~)=−ln⁡p(s~,x~,u~|m) Denote the Shannon entropy of the density q by H[q]=Eq[−log⁡(q)]. We can then write the variational free energy in two ways:

F(s~,μ~)=Eq[G(s~,x~,u~)]−H[q(x~,u~|μ~)]=−ln⁡p(s~|m)+DKL[q(x~,u~|μ~)||p(x~,u~|s~,m)] 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 q(x~,u~∣μ~)=𝒩(μ~,C) the variational density is Gaussian and the precision that minimizes free energy is C−1=Π=∂μ~μ~G(μ~). This means that free-energy can be expressed in terms of the variational mean (omitting constants):

F=G(μ~)+12ln⁡|∂μ~μ~G(μ~)| The variational means that minimize the (path integral) of free energy can now be recovered by solving the generalized filter:

μ~˙=Dμ~−∂μ~F(s~,μ~) where D is a block matrix derivative operator of identify matrices such that Du~=[u′,u″,…]T

Variational basis Generalized filtering is based on the following lemma: The self-consistent solution to μ~˙=Dμ~−∂μ~F(s,μ~) satisfies the variational principle of stationary action, where action is the path integral of variational free energy

S=∫dtF(s~(t),μ~(t)) Proof: self-consistency requires the motion of the mean to be the mean of the motion and (by the fundamental lemma of variational calculus)

μ~˙=Dμ~⇔∂μ~F(s~,μ~)=0⇔δμ~S=0 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: μ~˙−Dμ~=−∂μ~F(s,μ~), where the frame itself minimizes variational free energy. For a related example in statistical physics, see Kerr and Graham who use ensemble dynamics in generalized coordinates to provide a generalized phase-space version of Langevin and associated Fokker-Planck equations. In practice, generalized filtering uses local linearization over intervals Δt to recover discrete updates

Δμ~=(exp⁡(Δt⋅J)−I)J−1μ~˙J=∂μ~μ~˙=D−∂μ~μ~F(s~,μ~) 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:

s=g(x,u)+ωsx˙=f(x,u)+ωx The corresponding generalized model (under local linearity assumptions) obtains the from the chain rule

s~=g~(x~,u~)+ω~ss=g(x,u)+ωss′=∂xg⋅x′+∂ug⋅u′+ω'ss″=∂xg⋅x″+∂ug⋅u″+ω′'s⋮x~˙=f~(x~,u~)+ω~xx˙=f(x,u)+ωxx˙′=∂xf⋅x′+∂uf⋅u′+ω'xx˙″=∂xf⋅x″+∂uf⋅u″+ω′'x⋮ Gaussian assumptions about the random fluctuations ω then prescribe the likelihood and empirical priors on the motion of hidden states

p(s~,x~,u~|m)=p(s~|x~,u~,m)p(Dx~|x,u~,m)p(x|m)p(u~|m)p(s~|x~,u~,m)=𝒩(g~(x~,u~),Σ~(x~,u~)s)p(Dx~|x,u~,m)=𝒩(f~(x~,u~),Σ~(x~,u~)x) The covariances Σ~=V⊗Σ factorize into a covariance among variables and correlations V among generalized fluctuations that encodes their autocorrelation:

V=[10ρ¨(0)⋯0−ρ¨(0)0 ρ¨(0) 0 ρ¨¨(0) ⋮ ⋱ ] Here, ρ¨(0) is the second derivative of the autocorrelation function evaluated at zero. This is a ubiquitous measure of roughness in the theory of stochastic processes. Crucially, the precision (inverse variance) of high order derivatives fall to zero fairly quickly, which means it is only necessary to model relatively low order generalized motion (usually between two and eight) for any given or parameterized autocorrelation function.

Special cases

Filtering discrete time series When time series are observed as a discrete sequence of N observations, the implicit sampling is treated as part of the generative process, where (using Taylor's theorem)

[s1,…,sN]T=(E⊗I)⋅s~(t):Eij=(i−t)(j−1)(j−1)! 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).

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Generalized filtering

Start with the simplest possible case. Write down what Generalized filtering claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In biology, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Generalized filtering before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Generalized filtering ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Generalized filtering

In research
Generalized filtering appears in biology research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Generalized filtering in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Generalized filtering is common in secondary-school and first-year university syllabi. It links to neighbouring topics Bayesian estimation, Control theory, Linear filters, so understanding it makes those chapters shorter.
In everyday life
Look for Generalized filtering outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Generalized filtering” →

How to study Generalized filtering in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Generalized filtering means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Generalized filtering out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Generalized filtering in simple terms?

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.

Why does Generalized filtering matter?

Because it connects several biology ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Generalized filtering?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Generalized filtering.

Tags

  • Bayesian estimation
  • Control theory
  • Linear filters
  • Markov models
  • Nonlinear filters
  • Signal estimation
  • Stochastic differential equations
  • Systems theory

Keep exploring