← Stochastic Differential Equations

07

Constructing a stochastic SIR model

The stochastic SIR model has two independent event channels, but their noise contributions must be shared between the compartments changed by each event.

Start from two event channels

EventState-change vector \((S,I,R)\)Rate
Infection\((-1,+1,0)\)\(a_1=\beta SI/N\)
Recovery\((0,-1,+1)\)\(a_2=\gamma I\)

Each event produces both a mean contribution and a random contribution in its own state-change direction.

The stochastic SIR equations

\[ dS=-a_1dt-\sqrt{a_1}dW_1, \] \[ dI=(a_1-a_2)dt+\sqrt{a_1}dW_1-\sqrt{a_2}dW_2, \] \[ dR=a_2dt+\sqrt{a_2}dW_2. \]

\(W_1\) and \(W_2\) are independent Brownian motions representing infection and recovery fluctuations.

Why the same increment must be shared

An infection removes exactly what it adds: the term \(-\sqrt{a_1}dW_1\) in \(S\) is paired with \(+\sqrt{a_1}dW_1\) in \(I\). Likewise, recovery noise leaves \(I\) and enters \(R\). Therefore

\[dS+dI+dR=0.\]

Using separate random numbers for the two sides of one event would destroy population conservation.

Interactive Python laboratory

Interactive PythonStochastic SIR construction

Output

Run the code to see the result.

Matrix viewpoint

With state-change matrix \(V\) and rate vector \(a(X)\), the event-derived diffusion can be written

\[dX=Va(X)dt+V\sqrt{\operatorname{diag}(a(X))}dW.\]

This compact form becomes especially useful when SEIR adds a third event channel.

Conditions and interpretation

What this lesson adds

You can now construct a multivariable SIR diffusion from event vectors, preserve population through shared noise, and distinguish independent event channels from independent compartment noise.