← Stochastic Differential Equations

SDE biological models

Stochastic differential equations extend ordinary differential-equation models by allowing the biological variables to fluctuate randomly through continuous time.

Core idea. A biological SDE should describe both how the system tends to change and how random variability enters that change.

From a deterministic model to an SDE

Suppose a deterministic biological model is

\[\frac{dX}{dt}=f(X,t).\]

In differential notation,

\[dX_t=f(X_t,t)dt.\]

An SDE adds a stochastic contribution:

\[\boxed{dX_t=f(X_t,t)dt+g(X_t,t)dW_t}.\]
PartBiological meaning
\(f(X_t,t)dt\)systematic biological change: growth, infection, recovery, death, migration, etc.
\(g(X_t,t)dW_t\)continuous random fluctuation around that systematic change

Why not simply add random noise?

It is tempting to write

\[dX_t=f(X_t)dt+\sigma dW_t\]

just to make the model stochastic. Sometimes that is a useful phenomenological model, but in mechanistic biology the form of the noise should ideally reflect the process generating the randomness.

Noise should not be chosen only because the graph looks realistic. Its magnitude and structure should be linked to biological assumptions, data, or an underlying event-based model whenever possible.

Two common ways biological SDEs arise

ApproachIdea
phenomenological noisechoose a diffusion term to represent unresolved environmental or measurement variability
diffusion approximationderive drift and diffusion from underlying stochastic event rates such as births, deaths, infections and recoveries

The second approach often gives the diffusion coefficient a direct mechanistic interpretation.

Example 1: stochastic population growth

The deterministic exponential-growth model is

\[\frac{dX}{dt}=rX.\]

A simple stochastic version with multiplicative noise is

\[\boxed{dX_t=rX_tdt+\sigma X_tdW_t}.\]

The drift \(rX_t\) gives systematic proportional growth. The diffusion \(\sigma X_t\) means the magnitude of random fluctuations increases with population size.

Why multiplicative noise can make biological sense

If the population is twice as large, there may be roughly twice as many opportunities for random births, deaths, interactions or environmental responses. A state-dependent diffusion term can represent that idea.

This differs from additive noise,

\[dX_t=rX_tdt+\sigma dW_t,\]

where random fluctuations have the same absolute size regardless of the current population.

Same deterministic growth, different stochastic paths

Deterministic exponential growth and three Euler–Maruyama trajectories of \(dX=rXdt+\sigma XdW\), all starting from the same population. The legend is above the plotting region. Individual stochastic paths differ, although the drift mechanism is the same.

Example 2: stochastic logistic growth

The deterministic logistic model is

\[\frac{dX}{dt}=rX\left(1-\frac{X}{K}\right).\]

A stochastic extension might be

\[\boxed{dX_t=rX_t\left(1-\frac{X_t}{K}\right)dt+\sigma X_tdW_t}.\]

Here the drift still contains density dependence and carrying capacity \(K\), while the diffusion represents proportional environmental variability.

Important. The drift preserves the biological mechanism of the deterministic model. The diffusion specifies the stochastic mechanism added to it.

Event-based derivation: the important idea

Now consider a population where the state changes through discrete events. Suppose state \(X=i\) has

\[\text{upward event rate}=b(i),\qquad\text{downward event rate}=d(i).\]

Over a short interval \(\Delta t\), the expected change is approximately

\[E[\Delta X\mid X=i]\approx[b(i)-d(i)]\Delta t.\]

The variance of the change is approximately

\[\operatorname{Var}(\Delta X\mid X=i)\approx[b(i)+d(i)]\Delta t.\]

Why difference gives drift but sum gives variance

An upward event contributes \(+1\); a downward event contributes \(-1\). Their expected signed effects therefore subtract:

\[\boxed{\text{drift}=b(i)-d(i)}.\]

But when variability is calculated, both event types contribute positive squared changes because

\[(+1)^2=(-1)^2=1.\]

Therefore their variance contributions add:

\[\boxed{\text{variance rate}=b(i)+d(i)}.\]
This gives a very useful rule. For a simple birth–death process, the SDE diffusion coefficient is the square root of the sum of the event rates.

The corresponding diffusion approximation

The birth–death CTMC can therefore be approximated by

\[\boxed{dX_t=[b(X_t)-d(X_t)]dt+\sqrt{b(X_t)+d(X_t)}\,dW_t}.\]

The deterministic drift comes from the net event rate. The diffusion comes from the total event variability.

Example 3: SIS epidemic

Let \(I(t)\) be the infectious population in an SIS model with total population \(N\). The event rates are

\[b(i)=\beta\frac{(N-i)i}{N}\]

for infection and

\[d(i)=\gamma i\]

for recovery.

The deterministic net change is

\[b(i)-d(i)=\beta\frac{(N-i)i}{N}-\gamma i.\]

SIS diffusion approximation

Using the birth–death rule gives

\[\boxed{dI_t=\left[\beta\frac{(N-I_t)I_t}{N}-\gamma I_t\right]dt+\sqrt{\beta\frac{(N-I_t)I_t}{N}+\gamma I_t}\,dW_t}.\]

The first bracket is exactly the deterministic SIS drift. The square-root term measures the stochastic variation generated by infection and recovery events.

Why this diffusion coefficient makes sense

If infection and recovery events are both frequent, there are many opportunities for random event-count fluctuations, so the diffusion magnitude is larger.

If both event rates approach zero, the event-driven stochastic variation also approaches zero.

Mechanistic interpretation. Infection and recovery contribute with opposite signs to the mean change, but both contribute positively to uncertainty.

CTMC and SDE describe randomness differently

CTMCSDE diffusion approximation
integer-valued statescontinuous-valued states
individual events are explicitmany event fluctuations are approximated continuously
step-like trajectoriescontinuous rough trajectories
natural for small populations and extinctionoften efficient for larger populations

Visual comparison: deterministic, CTMC-like and SDE behaviour

Deterministic SIS solution and several numerical SDE diffusion-approximation paths using the mechanistic drift and diffusion terms above. The stochastic paths fluctuate continuously around the systematic epidemic tendency.

Why an SDE can produce non-integer values

An SDE approximation may produce values such as

\[I(t)=12.7.\]

That does not mean 0.7 of a person exists. It means the discrete event process has been approximated by a continuous stochastic variable.

This approximation is often more reasonable when counts are sufficiently large.

Boundary problems

A naïve SDE approximation can sometimes produce biologically impossible values such as negative populations.

This is a limitation, not just a plotting problem. If boundaries such as \(X=0\) are biologically important, the SDE formulation and numerical method must be chosen carefully. A CTMC may be preferable when exact extinction behaviour matters.

Environmental noise versus demographic noise

TypeInterpretation
demographic stochasticityrandomness from individual births, deaths, infections, recoveries and other discrete events
environmental stochasticityrandom changes in external conditions affecting many individuals or rates simultaneously

These sources can lead to different diffusion structures and should not automatically be represented by the same noise term.

Several biological variables

For a model with several compartments, write

\[\mathbf X_t=(X_{1,t},\ldots,X_{m,t})^T.\]

A multidimensional SDE has the form

\[\boxed{d\mathbf X_t=\mathbf a(\mathbf X_t,t)dt+B(\mathbf X_t,t)d\mathbf W_t}.\]

The drift vector \(\mathbf a\) describes systematic changes in all compartments. The diffusion matrix \(B\) describes the magnitudes and correlations of stochastic changes.

Why one Brownian motion is often not enough

Different biological events may create different directions of stochastic change. For an SIR epidemic, infection decreases \(S\) and increases \(I\), while recovery decreases \(I\) and increases \(R\).

Using separate Brownian drivers for distinct event mechanisms can preserve this structure and the induced correlations between compartments.

SIR event-vector view

Let

\[\mathbf X=(S,I,R)^T.\]

An infection event has state-change vector

\[\boldsymbol\nu_1=(-1,+1,0)^T,\]

while recovery has

\[\boldsymbol\nu_2=(0,-1,+1)^T.\]

If their rates are \(a_1(\mathbf X)\) and \(a_2(\mathbf X)\), a diffusion approximation can be written schematically as

\[d\mathbf X=\left[\boldsymbol\nu_1a_1+\boldsymbol\nu_2a_2\right]dt+\boldsymbol\nu_1\sqrt{a_1}\,dW_1+\boldsymbol\nu_2\sqrt{a_2}\,dW_2.\]

This shows how the stochastic terms can be derived directly from the underlying event mechanisms.

Why this event-vector formulation is useful

The same infection event simultaneously changes two compartments. Using its change vector in both the drift and diffusion automatically preserves that connection.

One biological event can create correlated stochastic changes across several compartments.

Euler–Maruyama simulation

For a one-dimensional biological SDE

\[dX_t=f(X_t,t)dt+g(X_t,t)dW_t,\]

Euler–Maruyama uses

\[\boxed{X_{n+1}=X_n+f(X_n,t_n)\Delta t+g(X_n,t_n)\sqrt{\Delta t}\,Z_n},\]

where

\[Z_n\sim N(0,1).\]

This produces one numerical stochastic trajectory. Repeating the simulation produces a distribution of possible biological histories.

What can repeated SDE simulations tell us?

QuantityBiological question
mean trajectoryWhat is the average behaviour across possible histories?
varianceHow uncertain is the state at time \(t\)?
peak distributionHow variable is the maximum epidemic or population size?
threshold probabilityHow often is a biologically important level crossed?

SDEs are not automatically “better” than deterministic models

An SDE adds information about uncertainty, but it also adds assumptions and parameters. If the biological question concerns only average behaviour and random variability is negligible, a deterministic model may be sufficient.

If extinction, outbreak risk, threshold crossing or uncertainty matter, a stochastic model can provide information that a single deterministic trajectory cannot.

Choosing between CTMC and SDE

Prefer CTMC whenPrefer SDE when
individual events mattercontinuous approximation is acceptable
counts are smallcounts are moderately large
exact extinction is importantcontinuous uncertainty is the main interest
event structure is centralcomputational efficiency or analytic approximation is useful

The modelling workflow

define biological events→derive rates→obtain drift→obtain diffusion→write SDE→simulate and analyse uncertainty
Key idea. A biological SDE should not be thought of as a deterministic model with arbitrary noise added. The drift should represent the systematic biological mechanism, while the diffusion should represent a justified source of stochastic variability. When derived from event rates, the drift comes from the net event effect and the diffusion from the variance contributed by those events.