← Moment Equations

06

Deriving second-moment equations

Second moments follow from how each event changes the square of the stochastic state.

Squaring changes the jump contribution

For current state \(i\), a birth changes \(i^2\) by

\[(i+1)^2-i^2=2i+1,\]

and a removal changes it by

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

Derive the second-moment equation

Multiply each squared jump change by its rate and take expectation:

\[ \frac{d}{dt}\mathbb E[I^2] = \mathbb E[(2I+1)\lambda I+(-2I+1)\mu I]. \]

With \(m_1=\mathbb E[I]\) and \(m_2=\mathbb E[I^2]\),

\[ \frac{dm_2}{dt} = 2(\lambda-\mu)m_2+(\lambda+\mu)m_1. \]

This equation is closed together with \(m_1'=(\lambda-\mu)m_1\).

Obtain the variance equation

\[v=m_2-m_1^2.\]

Differentiating and substituting the moment equations gives

\[ \frac{dv}{dt} = 2(\lambda-\mu)v+(\lambda+\mu)m_1. \]

The additional \((\lambda+\mu)m_1\) term creates stochastic variation even when the initial state has zero variance.

Interactive Python laboratory

Interactive PythonSecond moment and variance

Output

Run the code to see the result.

Why the second moment is not the variance

\(m_2\) includes both squared mean and spread. Variance removes the squared mean. Always calculate \(v=m_2-m_1^2\) before interpreting uncertainty.

What this lesson adds

You can now derive a second-moment equation from squared jump changes, obtain the variance equation and explain how stochastic events generate variance from a deterministic initial condition.