Continuous-Time Markov Chains

Thirteen modules on continuous-time Markov chains and on what happens when their rates come in two very different sizes: fast mixing inside groups of states, slow movement between them. Run the chains, change the rates and the small parameter ε, watch the equations solve themselves, then check yourself with concept questions and practice problems.

Follows the chapter order of G. G. Yin and Q. Zhang, Continuous-Time Markov Chains and Applications: A Two-Time-Scale Approach, 2nd ed. (Springer, Stochastic Modelling and Applied Probability 37, 2013), covering all ten chapters. Chapter numbers refer to that book; the questions, examples and models here are written for this page.

SimulationYin–Zhang, Ch. 1: Introduction and Overview · Ch. 2: Mathematical Preliminaries

Generators and sample paths

A continuous-time Markov chain on finitely many states is determined by one matrix, its generator QQ. The diagonal says how long the chain waits in each state, and the off-diagonal entries say where it goes next. Set the rates below and run the chain.

The idea

Generator. An m×mm\times m matrix Q=(qij)Q=(q_{ij}) with qij≥0q_{ij}\ge 0 for i≠ji\neq j and every row summing to zero, so qii=−∑j≠iqijq_{ii}=-\sum_{j\neq i}q_{ij}. Write qi=−qiiq_i=-q_{ii} for the total rate of leaving ii. A time-dependent Q(t)Q(t) must have this form at each tt (the book also asks for measurability and bounded entries).
Construction from rates. In state ii, wait a time that is exponential with rate qiq_i (mean 1/qi1/q_i), then jump to j≠ij\neq i with probability qij/qiq_{ij}/q_i, independently of the past. The sequence of states visited is the jump chain, a discrete-time chain with those transition probabilities. If qi=0q_i=0, state ii is absorbing.

The transition matrix P(t)=(P(α(t)=j|α(0)=i))P(t)=\big(P(\alpha(t)=j\mid\alpha(0)=i)\big) then satisfies P(t+s)=P(t)P(s)P(t+s)=P(t)P(s) and

P(α(t+h)=j|α(t)=i)=qijh+o(h)(j≠i),P(t)=eQt.P(\alpha(t+h)=j\mid \alpha(t)=i) = q_{ij}\,h + o(h)\quad (j\neq i), \qquad P(t)=e^{Qt}.
Martingale characterisation. QQ generates α(⋅)\alpha(\cdot) exactly when, for every function ff on the state space,
f(α(t))−∫0t(Qf)(α(s))ds,(Qf)(i)=∑j≠iqij(f(j)−f(i)),f(\alpha(t)) - \int_0^t (Qf)(\alpha(s))\,ds, \qquad (Qf)(i)=\sum_{j\neq i} q_{ij}\big(f(j)-f(i)\big),
is a martingale. This is the definition the book works with, and it is what makes the expected-value equations of later modules come out in one line.
Long-run time fractions. If QQ is irreducible (every state can reach every other), then with probability one 1t∫0tI{α(s)=i}ds→νi\frac1t\int_0^t I_{\{\alpha(s)=i\}}\,ds \to \nu_i, where ν\nu is the unique probability vector with νQ=0\nu Q = 0.

Why two time scales. In the systems the book has in mind (machines that fail and get repaired, queues, networks, economic regimes) some rates are much larger than others. Writing the generator as Qε=Q~/ε+Q^Q^\varepsilon=\tilde Q/\varepsilon+\hat Q, with a small ε>0\varepsilon>0, separates the fast moves from the slow ones. Modules 4 to 13 are about that limit. Note that Q/εQ/\varepsilon generates the same chain as QQ, only run 1/ε1/\varepsilon times faster.

Explore

Speed
Arrow width is the rate qijq_{ij}. The filled node is the current state, and its outgoing arrows are highlighted.
fraction of time so far stationary νi\nu_i. Below: the last 12 time units of the path.

Worked example

Take the generator

Q=(−3211−1022−4).Q=\begin{pmatrix} -3 & 2 & 1\\ 1 & -1 & 0\\ 2 & 2 & -4\end{pmatrix}.

Describe how the chain moves, find its stationary distribution, and compare the fraction of time in each state with the fraction of jumps into it.

  1. What are the mean holding times in states 1, 2, 3?

    The leaving rates are q1=3, q2=1, q3=4q_1=3,\ q_2=1,\ q_3=4, so the mean holding times are 1/3, 1, 1/41/3,\ 1,\ 1/4.

  2. Write down the transition matrix of the jump chain.

    Divide each off-diagonal entry by its row's leaving rate and put zeros on the diagonal:

    Π=(02/31/31001/21/20).\Pi=\begin{pmatrix} 0 & 2/3 & 1/3\\ 1 & 0 & 0\\ 1/2 & 1/2 & 0\end{pmatrix}.

    From state 2 the chain always returns to 1.

  3. Solve νQ=0\nu Q=0, ν1+ν2+ν3=1\nu_1+\nu_2+\nu_3=1.

    The third column gives ν1−4ν3=0\nu_1-4\nu_3=0, so ν1=4ν3\nu_1=4\nu_3. The first column gives −3ν1+ν2+2ν3=0-3\nu_1+\nu_2+2\nu_3=0, so ν2=10ν3\nu_2=10\nu_3. The second column, 2ν1−ν2+2ν3=8ν3−10ν3+2ν3=02\nu_1-\nu_2+2\nu_3=8\nu_3-10\nu_3+2\nu_3=0, checks out. Normalising,

    ν=115(4, 10, 1).\nu=\tfrac1{15}(4,\ 10,\ 1).
  4. The jump chain has its own stationary distribution π\pi (with πΠ=π\pi\Pi=\pi). How is it related to ν\nu?

    The chain enters state ii at long-run rate νiqi\nu_i q_i (time fraction times leaving rate), so πi∝νiqi\pi_i\propto\nu_iq_i:

    π∝(4⋅3, 10⋅1, 1⋅4)=(12,10,4),π=113(6,5,2).\pi\propto(4\cdot3,\ 10\cdot1,\ 1\cdot4)=(12,10,4),\qquad \pi=\tfrac1{13}(6,5,2).

    Check: π1=π2+12π3=513+113=613\pi_1=\pi_2+\tfrac12\pi_3=\tfrac{5}{13}+\tfrac1{13}=\tfrac6{13}. State 1 gets the most jumps but state 2 holds the most time, because the chain lingers there.

Check your understanding

Row ii of a generator is (1, −4, 3)(\,1,\ -4,\ 3\,), with qii=−4q_{ii}=-4 in the middle. What is the chance the next jump goes to the third state, and how long does the chain wait on average?

  1. Probability 3/43/4; mean wait 1/41/4.
  2. Probability 3/43/4; mean wait 44.The holding time is exponential with rate 4. Its mean is the reciprocal of the rate.
  3. Probability 3h3\,h in a short time hh; there is no single "next jump" probability.3h3h is the chance of a jump to state 3 within time hh. Conditioned on a jump happening, the destination has a fixed distribution.
The two exits race as independent exponential clocks with rates 1 and 3. The first ring comes after an Exp(4)\mathrm{Exp}(4) time, and the rate-3 clock wins with probability 3/(1+3)3/(1+3).

Why must every row of a generator sum to zero?

  1. Because the stationary distribution satisfies νQ=0\nu Q=0.νQ=0\nu Q=0 is a statement about the columns, weighted by ν\nu. It is a property of one special vector, not of the rows.
  2. Because each row of P(t)=eQtP(t)=e^{Qt} sums to 1 for all tt; differentiate at t=0t=0.
  3. Because probabilities are nonnegative.Nonnegativity is why the off-diagonal entries are ≥0\ge0. It says nothing about the sum.
P(t)𝟏=𝟏P(t)\mathbf 1=\mathbf 1 for all tt, and ddtP(t)|t=0=Q\frac{d}{dt}P(t)\big|_{t=0}=Q, so Q𝟏=0Q\mathbf 1=0. In words: the rate of leaving ii equals the sum of the rates of going to each other state.

Chain A has generator QQ and chain B has generator 10Q10\,Q. Which is true?

  1. B has a different stationary distribution, ten times larger.ν(10Q)=10νQ=0\nu(10Q)=10\,\nu Q=0: the same ν\nu solves both systems, and it must still sum to 1.
  2. B has a different jump chain.The jump probabilities are ratios qij/qiq_{ij}/q_i; multiplying every rate by 10 cancels.
  3. Same jump chain and same ν\nu, but B runs ten times faster: αB(t)\alpha_B(t) has the law of αA(10t)\alpha_A(10t).
Scaling a generator rescales time and nothing else. That is the starting point of the two-time-scale theory: Q/εQ/\varepsilon is the chain of QQ run at speed 1/ε1/\varepsilon, which mixes in time of order ε\varepsilon.

Practice

The two-state chainAn explicit transition matrix

A two-state chain jumps 1→21\to2 at rate λ>0\lambda>0 and 2→12\to1 at rate μ>0\mu>0. Find P(t)=eQtP(t)=e^{Qt} explicitly and its limit as t→∞t\to\infty.

Hint

p11(t)p_{11}(t) solves p11′=−λp11+μ(1−p11)p_{11}'=-\lambda p_{11}+\mu(1-p_{11}). Alternatively, QQ has eigenvalues 00 and −(λ+μ)-(\lambda+\mu).

Solution

The equation p11′=μ−(λ+μ)p11p_{11}'=\mu-(\lambda+\mu)p_{11} with p11(0)=1p_{11}(0)=1 gives

P(t)=1λ+μ(μ+λe−(λ+μ)tλ−λe−(λ+μ)tμ−μe−(λ+μ)tλ+μe−(λ+μ)t).P(t)=\frac1{\lambda+\mu}\begin{pmatrix}\mu+\lambda e^{-(\lambda+\mu)t} & \lambda-\lambda e^{-(\lambda+\mu)t}\\ \mu-\mu e^{-(\lambda+\mu)t} & \lambda+\mu e^{-(\lambda+\mu)t}\end{pmatrix}.

Both rows tend to ν=(μ,λ)/(λ+μ)\nu=(\mu,\lambda)/(\lambda+\mu), at the exponential rate λ+μ\lambda+\mu.

From the martingale to the forward equationTaking expectations

Let pj(t)=P(α(t)=j)p_j(t)=P(\alpha(t)=j). Using the martingale characterisation with f=I{⋅=j}f=I_{\{\cdot=j\}}, show that pj′(t)=∑ipi(t)qijp_j'(t)=\sum_i p_i(t)\,q_{ij}.

Solution

For f(k)=I{k=j}f(k)=I_{\{k=j\}} we get (Qf)(i)=∑kqikf(k)=qij(Qf)(i)=\sum_k q_{ik}f(k)=q_{ij} (using ∑kqik=0\sum_k q_{ik}=0). A martingale has constant expectation, so

pj(t)−pj(0)=𝔼∫0tqα(s)jds=∫0t∑ipi(s)qijds.p_j(t)-p_j(0)=\mathbb E\!\int_0^t q_{\alpha(s)j}\,ds=\int_0^t\sum_i p_i(s)q_{ij}\,ds.

Differentiating gives p′(t)=p(t)Qp'(t)=p(t)Q, the forward equation of the next module.

InteractiveYin–Zhang, Ch. 2: Mathematical Preliminaries

The forward equation and irreducibility

The distribution of a Markov chain solves a linear differential equation, p′(t)=p(t)Qp'(t)=p(t)Q. For three states every solution is a curve in a triangle, and you can drag its starting point. When the generator is weakly irreducible, every curve ends at the same point.

The idea

Kolmogorov equations. Write P(t,s)P(t,s) for the matrix of probabilities P(α(t)=j|α(s)=i)P(\alpha(t)=j\mid\alpha(s)=i), t≥st\ge s. Then
∂∂tP(t,s)=P(t,s)Q(t)  (forward),∂∂sP(t,s)=−Q(s)P(t,s)  (backward),\frac{\partial}{\partial t}P(t,s)=P(t,s)\,Q(t)\ \ \text{(forward)},\qquad \frac{\partial}{\partial s}P(t,s)=-Q(s)\,P(t,s)\ \ \text{(backward)},
with P(s,s)=IP(s,s)=I. The row vector p(t)=(P(α(t)=1),…,P(α(t)=m))p(t)=(P(\alpha(t)=1),\dots,P(\alpha(t)=m)) solves p′(t)=p(t)Q(t)p'(t)=p(t)Q(t). For constant QQ, P(t,s)=eQ(t−s)P(t,s)=e^{Q(t-s)}.
Weak irreducibility. QQ is weakly irreducible if the system νQ=0, ∑iνi=1\nu Q=0,\ \sum_i\nu_i=1 has exactly one solution. That solution is then automatically ≥0\ge 0. QQ is irreducible if in addition every νi>0\nu_i>0. Equivalently, QQ is weakly irreducible when fQ=0fQ=0 and f𝟏=0f\mathbf 1=0 force f=0f=0; its rank is then m−1m-1.
Quasi-stationary distribution. For a time-dependent Q(t)Q(t), the solution ν(t)\nu(t) of ν(t)Q(t)=0, ν(t)𝟏=1\nu(t)Q(t)=0,\ \nu(t)\mathbf 1=1. It is the distribution the chain would settle into if the rates were frozen at their time-tt values. It is not, in general, the distribution of α(t)\alpha(t).
Exponential convergence. If a constant QQ is weakly irreducible, there are K,κ>0K,\kappa>0 with |eQt−𝟏ν|≤Ke−κt\big|e^{Qt}-\mathbf 1\nu\big|\le Ke^{-\kappa t}. Every row of eQte^{Qt} tends to ν\nu, and κ\kappa can be taken just below the smallest |Reλ||\mathrm{Re}\,\lambda| over the nonzero eigenvalues λ\lambda of QQ.
Fredholm alternative. If QQ is weakly irreducible, fQ=gfQ=g has a solution exactly when g𝟏=0g\mathbf 1=0, and fixing f𝟏f\mathbf 1 makes it unique. Every expansion in Modules 4 to 6 is built by solving equations of this form.

Explore

Generator
Each point of the triangle is a distribution (p1,p2,p3)(p_1,p_2,p_3); a corner is a sure state. Drag p(0). Dots mark t=1,2,…t=1,2,\dots
p1p_1 p2p_2 p3p_3, with νi\nu_i dashed.

Worked example

A two-state chain has time-varying rates: 1→21\to2 at rate λ(t)\lambda(t) and 2→12\to1 at rate μ(t)\mu(t). Compare the quasi-stationary distribution with the actual distribution p(t)p(t).

  1. Find ν(t)\nu(t). When is Q(t)Q(t) weakly irreducible, and when irreducible?

    ν(t)Q(t)=0\nu(t)Q(t)=0 reads −λν1+μν2=0-\lambda\nu_1+\mu\nu_2=0, so ν(t)=(μ(t),λ(t))/(λ(t)+μ(t))\nu(t)=\big(\mu(t),\lambda(t)\big)/\big(\lambda(t)+\mu(t)\big). This needs λ+μ>0\lambda+\mu>0 (weak irreducibility); both entries are positive when both rates are positive (irreducibility).

  2. Write the forward equation for p1(t)p_1(t) alone.

    Using p2=1−p1p_2=1-p_1:  p1′=−λp1+μ(1−p1)=−(λ+μ)p1+μ.\ p_1'=-\lambda p_1+\mu(1-p_1)=-(\lambda+\mu)\,p_1+\mu.

  3. Solve it when the rates are constant.

    p1(t)=ν1+(p1(0)−ν1)e−(λ+μ)t.p_1(t)=\nu_1+\big(p_1(0)-\nu_1\big)e^{-(\lambda+\mu)t}.

    The gap to ν\nu closes at rate λ+μ\lambda+\mu, the absolute value of the nonzero eigenvalue of QQ.

  4. Now let the rates vary. What equation does the gap d(t)=p1(t)−ν1(t)d(t)=p_1(t)-\nu_1(t) satisfy, and what does it say?

    Since μ=(λ+μ)ν1\mu=(\lambda+\mu)\nu_1, the equation becomes p1′=−(λ+μ)(p1−ν1)p_1'=-(\lambda+\mu)(p_1-\nu_1), so

    d′(t)=−(λ(t)+μ(t))d(t)−ν1′(t).d'(t)=-\big(\lambda(t)+\mu(t)\big)\,d(t)-\nu_1'(t).

    The chain is pulled toward ν(t)\nu(t) at rate λ+μ\lambda+\mu while ν(t)\nu(t) moves away at speed ν1′\nu_1'. If the rates are λ0(t)/ε\lambda_0(t)/\varepsilon and μ0(t)/ε\mu_0(t)/\varepsilon, then ν\nu does not depend on ε\varepsilon, the pull wins, and dd settles near −εν1′/(λ0+μ0)-\varepsilon\,\nu_1'/(\lambda_0+\mu_0), which is O(ε)O(\varepsilon). That small lag is exactly what Module 4 computes.

Check your understanding

Q=(−110000000)Q=\begin{pmatrix}-1&1&0\\0&0&0\\0&0&0\end{pmatrix}. Is QQ weakly irreducible?

  1. Yes: state 1 is transient, so its stationary probability is 0 and ν=(0,1,0)\nu=(0,1,0).(0,1,0)(0,1,0) is a solution, but is it the only one? Look at state 3.
  2. No: (0,s,1−s)(0,s,1-s) solves νQ=0, ν𝟏=1\nu Q=0,\ \nu\mathbf 1=1 for every s∈[0,1]s\in[0,1].
  3. Yes, because QQ has rank m−1m-1.Two rows of QQ are zero and the first is nonzero, so the rank is 1, not 2.
States 2 and 3 are both absorbing, two closed classes, so the long-run distribution depends on where the chain starts. Compare the "Two closed classes" generator in the explorer.

In the "Cyclic" example the path of p(t)p(t) spirals into ν\nu. What causes the spiral?

  1. The chain is periodic.A continuous-time chain is never periodic: pii(t)≥e−qit>0p_{ii}(t)\ge e^{-q_it}>0 for every tt.
  2. QQ has a pair of complex eigenvalues −a±ib-a\pm ib, so eQte^{Qt} contains terms e−atcos⁡bte^{-at}\cos bt and e−atsin⁡bte^{-at}\sin bt.
  3. Rounding error in the numerical solution.The spiral is real. Try smaller and smaller steps and it stays.
The probabilities still converge, at rate aa, but they overshoot and come back as they go. Generators of reversible chains (detailed balance) have only real eigenvalues, so their paths cannot spiral.

Q(t)Q(t) is weakly irreducible for every tt and varies slowly. Is p(t)=ν(t)p(t)=\nu(t) for all tt if p(0)=ν(0)p(0)=\nu(0)?

  1. Yes, because ν(t)\nu(t) is stationary.ν(t)\nu(t) would be stationary for a chain whose rates stayed frozen at time tt. Here they keep moving.
  2. No: p(t)p(t) lags behind ν(t)\nu(t), unless ν(t)\nu(t) happens to be constant.
Differentiate ν(t)Q(t)=0\nu(t)Q(t)=0: if p≡νp\equiv\nu then ν′=p′=pQ=νQ=0\nu'=p'=pQ=\nu Q=0, so ν\nu would have to be constant. The worked example measures the lag.

Practice

The solvability conditionOne direction of the Fredholm alternative

Let QQ be a generator. Show that if fQ=gfQ=g has a solution then g𝟏=0g\mathbf 1=0. If QQ is weakly irreducible, show the solution is unique once f𝟏f\mathbf 1 is fixed.

Solution

g𝟏=fQ𝟏=f⋅0=0g\mathbf 1=fQ\mathbf 1=f\cdot0=0. If f1Q=f2Q=gf_1Q=f_2Q=g with f1𝟏=f2𝟏f_1\mathbf 1=f_2\mathbf 1, then h=f1−f2h=f_1-f_2 has hQ=0hQ=0 and h𝟏=0h\mathbf 1=0, so h=0h=0 by the second form of weak irreducibility.

Why eQte^{Qt} is a stochastic matrixPositivity without probability

Show directly from the matrix exponential that eQte^{Qt} has nonnegative entries and rows summing to 1 when QQ is a generator.

Hint

Choose c≥maxi⁡qic\ge\max_i q_i. Then Q+cIQ+cI has nonnegative entries, and QQ and cIcI commute.

Solution

eQt=e−cte(Q+cI)t=e−ct∑ntnn!(Q+cI)ne^{Qt}=e^{-ct}e^{(Q+cI)t}=e^{-ct}\sum_n\frac{t^n}{n!}(Q+cI)^n, a sum of nonnegative matrices. And eQt𝟏=∑ntnn!Qn𝟏=𝟏e^{Qt}\mathbf 1=\sum_n\frac{t^n}{n!}Q^n\mathbf 1=\mathbf 1 since Q𝟏=0Q\mathbf 1=0. This also gives a way to simulate: run a Poisson clock of rate cc and move by I+Q/cI+Q/c at each tick (uniformisation).

SimulationYin–Zhang, Ch. 3: Markovian Models

Birth–death chains and a finite queue

Most Markov models are built by listing what can happen next and at what rate. In a birth–death chain the state only moves up or down by one, and that is enough to solve for the stationary distribution in closed form. Here it is for a queue with a waiting room of size KK.

The idea

Birth–death chain. On {0,1,…,K}\{0,1,\dots,K\}, the only nonzero off-diagonal rates are qn,n+1=λnq_{n,n+1}=\lambda_n (a birth) and qn,n−1=μnq_{n,n-1}=\mu_n (a death).
Detailed balance. If all λn,μn>0\lambda_n,\mu_n>0 in range, the stationary distribution satisfies νnλn=νn+1μn+1\nu_n\lambda_n=\nu_{n+1}\mu_{n+1}, so
νn=ν0∏k=0n−1λkμk+1,ν0 fixed by ∑nνn=1.\nu_n=\nu_0\prod_{k=0}^{n-1}\frac{\lambda_k}{\mu_{k+1}},\qquad \nu_0 \text{ fixed by } \textstyle\sum_n\nu_n=1.
The reason: the cut between {0,…,n}\{0,\dots,n\} and {n+1,…,K}\{n+1,\dots,K\} is crossed by a single pair of edges, and in equilibrium the flow across a cut is zero.
A finite queue. Customers arrive at rate λ\lambda, one server works at rate μ\mu, and at most KK customers fit in the system; arrivals to a full system are turned away. This is the birth–death chain with λn=λ\lambda_n=\lambda (n<Kn<K), μn=μ\mu_n=\mu (n≥1n\ge1). With ρ=λ/μ≠1\rho=\lambda/\mu\neq1,
νn=(1−ρ)ρn1−ρK+1,n=0,…,K,\nu_n=\frac{(1-\rho)\,\rho^n}{1-\rho^{K+1}},\qquad n=0,\dots,K,
and νn=1/(K+1)\nu_n=1/(K+1) when ρ=1\rho=1. No condition ρ<1\rho<1 is needed: the state space is finite.
Arrivals see time averages. Poisson arrivals are independent of the queue's past, so the fraction of arrivals that find the system full equals the fraction of time it is full, νK\nu_K.

The book's catalogue of models goes on: system reliability (components failing and being repaired), competing risks, Cox processes, random evolutions, seasonal models, and chains inside optimisation algorithms and controlled systems. The common thread is time-scale separation: in each, some rates are naturally much larger than others, and Qε=Q~/ε+Q^Q^\varepsilon=\tilde Q/\varepsilon+\hat Q makes that explicit.

Explore

Speed
Queue length over the last 40 time units.
fraction of time at each length so far νn\nu_n from detailed balance
Press Run. The blue bars converge to the gold ones, and the share of arrivals turned away converges to νK\nu_K, the share of time the queue is full. Try λ>μ\lambda>\mu: the queue does not blow up, it sits near KK and turns many customers away. Changing a rate restarts the statistics.

Worked example

Two identical machines each fail at rate λ\lambda while running. One repairer fixes failed machines one at a time at rate μ\mu. Let α(t)∈{0,1,2}\alpha(t)\in\{0,1,2\} be the number of failed machines. Find the long-run availability (at least one machine working) for λ=1, μ=4\lambda=1,\ \mu=4.

  1. Write the generator.

    With 0 failed, two machines can fail: rate 2λ2\lambda. With 1 failed, one can fail (rate λ\lambda) or the repair finishes (rate μ\mu). With 2 failed, only repair (rate μ\mu):

    Q=(−2λ2λ0μ−(λ+μ)λ0μ−μ).Q=\begin{pmatrix}-2\lambda & 2\lambda & 0\\ \mu & -(\lambda+\mu) & \lambda\\ 0 & \mu & -\mu\end{pmatrix}.
  2. Use detailed balance to express ν1,ν2\nu_1,\nu_2 in terms of ν0\nu_0.

    ν1=2λμν0\nu_1=\frac{2\lambda}{\mu}\nu_0 and ν2=λμν1=2λ2μ2ν0\nu_2=\frac{\lambda}{\mu}\nu_1=\frac{2\lambda^2}{\mu^2}\nu_0.

  3. Normalise with λ=1, μ=4\lambda=1,\ \mu=4, and give the availability.

    ν∝(1, 12, 18)\nu\propto(1,\ \tfrac12,\ \tfrac18), and the entries sum to 138\tfrac{13}8, so ν=113(8,4,1)\nu=\tfrac1{13}(8,4,1). Availability =1−ν2=1213≈0.923=1-\nu_2=\tfrac{12}{13}\approx0.923.

  4. Suppose repairs are much faster than failures: μ=μ0/ε\mu=\mu_0/\varepsilon. How does the downtime scale?

    ν2=2λ2/μ21+2λ/μ+2λ2/μ2=2λ2ε2/μ02+O(ε3)\nu_2=\dfrac{2\lambda^2/\mu^2}{1+2\lambda/\mu+2\lambda^2/\mu^2}=2\lambda^2\varepsilon^2/\mu_0^2+O(\varepsilon^3). A machine is under repair a fraction O(ε)O(\varepsilon) of the time, and the second one must fail during that short repair, which has probability O(ε)O(\varepsilon). Fast repairs make the chain spend almost all its time in state 0: a first glimpse of a two-time-scale model.

Check your understanding

In the finite queue, take λ=μ\lambda=\mu. What is the stationary distribution?

  1. There is none: the queue is critically loaded.That is true for an infinite waiting room. With room for only KK customers the chain is finite and irreducible.
  2. Uniform: νn=1/(K+1)\nu_n=1/(K+1).
  3. Concentrated at n=Kn=K.Detailed balance with λ=μ\lambda=\mu gives νn+1=νn\nu_{n+1}=\nu_n: no state is preferred.
νn+1/νn=λ/μ=1\nu_{n+1}/\nu_n=\lambda/\mu=1. Set λ=μ\lambda=\mu in the explorer: all the gold bars have the same height.

Why does the fraction of arrivals that are turned away equal νK\nu_K, the fraction of time the system is full?

  1. Because the server is idle exactly ν0\nu_0 of the time.True, but that is about state 0. What is special about the moments when customers arrive?
  2. Arrivals come from a Poisson process independent of the past of the queue, so the state an arrival sees has the time-stationary distribution.
  3. It doesn't: arrivals are more likely when the queue is short.Here the arrival rate is λ\lambda in every state, so arrivals do not prefer any state.
This is "Poisson arrivals see time averages". It fails when the arrival rate depends on the state: then arrivals sample states in proportion to νnλn\nu_n\lambda_n, not νn\nu_n.

A birth–death chain on {0,…,K}\{0,\dots,K\} has every λn\lambda_n and μn\mu_n positive. Is it reversible (does detailed balance hold)?

  1. Always.
  2. Only when λn=μn+1\lambda_n=\mu_{n+1} for all nn.That is the special case of a uniform ν\nu. Detailed balance only needs νnλn=νn+1μn+1\nu_n\lambda_n=\nu_{n+1}\mu_{n+1}, which can always be arranged.
  3. Only for the finite queue.The cut argument uses nothing about the particular rates.
Since the chain lives on a path graph, each cut is crossed only by n→n+1n\to n+1 and n+1→nn+1\to n, so zero net flow across every cut is detailed balance. Chains with cycles, like the cyclic generator of Module 2, need not be reversible.

Practice

A tiny queue by handLittle's law

Take K=2K=2, λ=1\lambda=1, μ=2\mu=2. Find ν\nu, the mean number in the system LL, the throughput, and the mean time a customer who gets in spends in the system.

Solution

ρ=12\rho=\tfrac12, so ν∝(1,12,14)\nu\propto(1,\tfrac12,\tfrac14), giving ν=17(4,2,1)\nu=\tfrac17(4,2,1). L=17(0+2+2)=47L=\tfrac17(0+2+2)=\tfrac47. Accepted customers arrive at rate λ(1−ν2)=67\lambda(1-\nu_2)=\tfrac67, which is also the throughput. Little's law: W=L/67=23W=L/\tfrac67=\tfrac23.

Zero flow across a cutDeriving detailed balance

For a birth–death chain with stationary ν\nu, add up the equations (νQ)k=0(\nu Q)_k=0 for k=0,…,nk=0,\dots,n and conclude νnλn=νn+1μn+1\nu_n\lambda_n=\nu_{n+1}\mu_{n+1}.

Solution

∑k≤n(νQ)k=∑iνi∑k≤nqik\sum_{k\le n}(\nu Q)_k=\sum_i\nu_i\sum_{k\le n}q_{ik}. For i≤ni\le n, the inner sum is minus the rate of leaving {0,…,n}\{0,\dots,n\} from ii, which is −λn-\lambda_n for i=ni=n and 0 otherwise. For i>ni>n it is the rate of entering {0,…,n}\{0,\dots,n\}, which is μn+1\mu_{n+1} for i=n+1i=n+1 and 0 otherwise. So the sum is −νnλn+νn+1μn+1=0-\nu_n\lambda_n+\nu_{n+1}\mu_{n+1}=0.

InteractiveYin–Zhang, Ch. 4: Asymptotic Expansions of Solutions for Forward Equations

A fast chain: outer expansion and initial layer

Speed a chain up by a factor 1/ε1/\varepsilon while its rates drift in ordinary time. Its distribution snaps to the quasi-stationary distribution within a time of order ε\varepsilon, then follows it. A matched asymptotic expansion describes both phases, with an error you can watch shrink in proportion to ε\varepsilon.

The idea

Let αε(t)\alpha^\varepsilon(t) be generated by Q(t)/εQ(t)/\varepsilon, with Q(t)Q(t) weakly irreducible and smooth on [0,T][0,T]. Its distribution solves

dpε(t)dt=1εpε(t)Q(t),pε(0)=p0.\frac{dp^\varepsilon(t)}{dt}=\frac1\varepsilon\,p^\varepsilon(t)\,Q(t),\qquad p^\varepsilon(0)=p^0.
Two-part expansion. Look for pε(t)=∑i=0nεiφi(t)+∑i=0nεiψi(t/ε)+enε(t)p^\varepsilon(t)=\sum_{i=0}^n\varepsilon^i\varphi_i(t)+\sum_{i=0}^n\varepsilon^i\psi_i(t/\varepsilon)+e^\varepsilon_n(t). The outer terms φi\varphi_i describe tt away from 0; the initial-layer terms ψi(τ)\psi_i(\tau), in the stretched time τ=t/ε\tau=t/\varepsilon, repair the start and decay exponentially in τ\tau.

Outer terms. Substitute and match powers of ε\varepsilon:

φ0(t)Q(t)=0,φk(t)Q(t)=dφk−1(t)dt(k≥1),\varphi_0(t)Q(t)=0,\qquad \varphi_k(t)Q(t)=\frac{d\varphi_{k-1}(t)}{dt}\quad(k\ge1),

with φ0𝟏=1\varphi_0\mathbf 1=1 and φk𝟏=0\varphi_k\mathbf 1=0 for k≥1k\ge1. So φ0(t)=ν(t)\varphi_0(t)=\nu(t), the quasi-stationary distribution, and each later equation is solvable by the Fredholm alternative because φk−1′𝟏=0\varphi_{k-1}'\mathbf 1=0.

Initial layer. In the stretched time, dψ0dτ=ψ0(τ)Q(0)\frac{d\psi_0}{d\tau}=\psi_0(\tau)Q(0) and ψ0(0)=p0−ν(0)\psi_0(0)=p^0-\nu(0), so

ψ0(τ)=(p0−ν(0))eQ(0)τ,\psi_0(\tau)=\big(p^0-\nu(0)\big)\,e^{Q(0)\tau},

which decays like e−κτe^{-\kappa\tau} because (p0−ν(0))𝟏=0(p^0-\nu(0))\mathbf 1=0.

Error bound. Under these assumptions (with QQ smooth enough for the order nn),  sup0≤t≤T⁡|pε(t)−∑i≤nεiφi(t)−∑i≤nεiψi(t/ε)|≤Kεn+1.\ \sup_{0\le t\le T}\Big|p^\varepsilon(t)-\sum_{i\le n}\varepsilon^i\varphi_i(t)-\sum_{i\le n}\varepsilon^i\psi_i(t/\varepsilon)\Big|\le K\varepsilon^{n+1}. For n=0n=0: pε(t)=ν(t)+ψ0(t/ε)+O(ε)p^\varepsilon(t)=\nu(t)+\psi_0(t/\varepsilon)+O(\varepsilon), and pε(t)→ν(t)p^\varepsilon(t)\to\nu(t) for every t>0t>0.
Watch out. The convergence is not uniform near t=0t=0 unless p0=ν(0)p^0=\nu(0), and even then the higher initial-layer terms ψ1,ψ2,…\psi_1,\psi_2,\dots need not vanish.

Explore

Two states. Rates λ(t)/ε\lambda(t)/\varepsilon for 1→21\to2 and μ/ε\mu/\varepsilon for 2→12\to1, with λ(t)=1.5+sin⁡πt\lambda(t)=1.5+\sin\pi t and μ=1\mu=1, so ν1(t)=1/(λ(t)+1)\nu_1(t)=1/(\lambda(t)+1).

p1ε(t)p^\varepsilon_1(t), exact ν1(t)\nu_1(t) ν1(t)+ψ0(t/ε)\nu_1(t)+\psi_0(t/\varepsilon), on 0≤t≤20\le t\le2
The initial layer in stretched time τ=t/ε\tau=t/\varepsilon. Here ψ0(τ)=(p1(0)−0.4)e−2.5τ\psi_0(\tau)=(p_1(0)-0.4)\,e^{-2.5\tau} for state 1.

Worked example

For the two-state chain of the explorer, with rates λ(t)/ε\lambda(t)/\varepsilon and μ(t)/ε\mu(t)/\varepsilon, find φ0\varphi_0, ψ0\psi_0 and the first outer correction φ1\varphi_1, and evaluate them at t=1t=1.

  1. What is φ0(t)\varphi_0(t)?

    The quasi-stationary distribution: φ0(t)=ν(t)=(μ,λ)/(λ+μ)\varphi_0(t)=\nu(t)=\big(\mu,\lambda\big)/(\lambda+\mu). With μ=1\mu=1, ν1(t)=1/(λ(t)+1)\nu_1(t)=1/(\lambda(t)+1).

  2. Find ψ0(τ)\psi_0(\tau).

    A zero-sum row vector (x,−x)(x,-x) times Q(0)Q(0) is −(λ(0)+μ(0))(x,−x)-(\lambda(0)+\mu(0))(x,-x), so

    ψ0(τ)=(p10−ν1(0))(1,−1)e−(λ(0)+μ(0))τ.\psi_0(\tau)=\big(p^0_1-\nu_1(0)\big)\,(1,-1)\,e^{-(\lambda(0)+\mu(0))\tau}.

    In the explorer λ(0)+μ=2.5\lambda(0)+\mu=2.5 and ν1(0)=0.4\nu_1(0)=0.4.

  3. Solve φ1Q=φ0′\varphi_1Q=\varphi_0' with φ1𝟏=0\varphi_1\mathbf 1=0.

    Write φ1=(c,−c)\varphi_1=(c,-c). Then φ1Q=−c(λ+μ)(1,−1)\varphi_1Q=-c(\lambda+\mu)(1,-1) and φ0′=ν1′(1,−1)\varphi_0'=\nu_1'(1,-1), so

    φ1(t)=−ν1′(t)λ(t)+μ(t)(1,−1).\varphi_1(t)=-\frac{\nu_1'(t)}{\lambda(t)+\mu(t)}\,(1,-1).

    When ν1\nu_1 rises, p1εp^\varepsilon_1 sits slightly below it: the chain lags behind its moving target by about εν1′/(λ+μ)\varepsilon\nu_1'/(\lambda+\mu), as in Module 2.

  4. Evaluate at t=1t=1, where λ=1.5\lambda=1.5 and λ′=πcos⁡π=−π\lambda'=\pi\cos\pi=-\pi.

    ν1(1)=1/2.5=0.4\nu_1(1)=1/2.5=0.4 and ν1′=−λ′/(λ+1)2=π/6.25≈0.5027\nu_1'=-\lambda'/(\lambda+1)^2=\pi/6.25\approx0.5027, so φ1,1(1)≈−0.5027/2.5≈−0.2011\varphi_{1,1}(1)\approx-0.5027/2.5\approx-0.2011. For ε=0.05\varepsilon=0.05: p1ε(1)≈0.4−0.0101=0.3899p^\varepsilon_1(1)\approx0.4-0.0101=0.3899. The explorer's last two boxes compare this with the exact value.

Check your understanding

Why can't the outer expansion ∑εiφi(t)\sum\varepsilon^i\varphi_i(t) alone match the initial condition pε(0)=p0p^\varepsilon(0)=p^0?

  1. φ0(0)=ν(0)\varphi_0(0)=\nu(0) is forced by φ0Q=0\varphi_0Q=0; it is not free to equal p0p^0.
  2. It can, if enough terms are kept.Every φk\varphi_k with k≥1k\ge1 carries a factor εk\varepsilon^k. No combination of them can close an O(1)O(1) gap p0−ν(0)p^0-\nu(0).
  3. Because the outer terms are not smooth at t=0t=0.They are as smooth as QQ. The trouble is their value at 0, not their smoothness.
The outer equations are algebraic at leading order, so they lose the initial condition. The initial-layer term, which lives on the fast time τ=t/ε\tau=t/\varepsilon, carries the mismatch and dies out within a few multiples of ε\varepsilon.

Q(0)Q(0) is a 3-state generator with nonzero eigenvalues −2-2 and −5-5. For small ε\varepsilon, how does the initial layer ψ0(t/ε)\psi_0(t/\varepsilon) decay?

  1. Like e−2te^{-2t}.The layer lives on the fast time t/εt/\varepsilon.
  2. Like e−5t/εe^{-5t/\varepsilon}.The fast mode dies first. What is left after that?
  3. Like e−2t/εe^{-2t/\varepsilon} (for a typical p0p^0).
ψ0(τ)=(p0−ν(0))eQ(0)τ\psi_0(\tau)=(p^0-\nu(0))e^{Q(0)\tau} is a combination of e−2τe^{-2\tau} and e−5τe^{-5\tau}, and the slower mode dominates. With ε=0.01\varepsilon=0.01 the layer is gone, to a few percent, by t≈0.02t\approx0.02.

Suppose p0=ν(0)p^0=\nu(0). Which is true?

  1. pε(t)=ν(t)p^\varepsilon(t)=\nu(t) exactly for all tt.Only if ν(t)\nu(t) is constant. Otherwise the chain lags behind its moving target.
  2. ψ0≡0\psi_0\equiv0, but pε(t)−ν(t)p^\varepsilon(t)-\nu(t) is still of order ε\varepsilon.
  3. The error becomes O(ε2)O(\varepsilon^2).The εφ1\varepsilon\varphi_1 term is still there; only the zeroth-order layer disappeared.
With p0=ν(0)p^0=\nu(0) the zeroth-order layer vanishes, but εφ1(t)\varepsilon\varphi_1(t) does not, and φ1(0)≠0\varphi_1(0)\neq0 when ν′(0)≠0\nu'(0)\neq0, so ψ1(0)=−φ1(0)\psi_1(0)=-\varphi_1(0) is nonzero too. In the explorer, set p1(0)=0.40p_1(0)=0.40: the gold curve coincides with the green one, but the blue one still lags by O(ε)O(\varepsilon).

Practice

Constant generatorsWhen the expansion terminates

If QQ does not depend on tt, show that pε(t)=ν+(p0−ν)eQt/εp^\varepsilon(t)=\nu+(p^0-\nu)e^{Qt/\varepsilon} exactly. Which terms of the expansion are nonzero?

Solution

pε(t)=p0eQt/ε=νeQt/ε+(p0−ν)eQt/εp^\varepsilon(t)=p^0e^{Qt/\varepsilon}=\nu e^{Qt/\varepsilon}+(p^0-\nu)e^{Qt/\varepsilon}, and νeQs=ν\nu e^{Qs}=\nu since νQ=0\nu Q=0. So φ0=ν\varphi_0=\nu, ψ0(τ)=(p0−ν)eQτ\psi_0(\tau)=(p^0-\nu)e^{Q\tau}, and all other terms vanish: φ1Q=ν′=0\varphi_1Q=\nu'=0 with φ1𝟏=0\varphi_1\mathbf 1=0 forces φ1=0\varphi_1=0, and so on.

Uniform away from zeroReading the error bound

Use the n=0n=0 bound to show that supδ≤t≤T⁡|pε(t)−ν(t)|=O(ε)\sup_{\delta\le t\le T}|p^\varepsilon(t)-\nu(t)|=O(\varepsilon) for each fixed δ>0\delta>0, while sup0≤t≤T⁡|pε(t)−ν(t)|\sup_{0\le t\le T}|p^\varepsilon(t)-\nu(t)| does not tend to 0 unless p0=ν(0)p^0=\nu(0).

Solution

|pε−ν|≤|ψ0(t/ε)|+Kε≤K′e−κδ/ε+Kε|p^\varepsilon-\nu|\le|\psi_0(t/\varepsilon)|+K\varepsilon\le K'e^{-\kappa\delta/\varepsilon}+K\varepsilon on [δ,T][\delta,T], and e−κδ/ε=o(ε)e^{-\kappa\delta/\varepsilon}=o(\varepsilon). At t=0t=0 the difference is |p0−ν(0)||p^0-\nu(0)| for every ε\varepsilon.

InteractiveYin–Zhang, Ch. 4: Asymptotic Expansions of Solutions for Forward Equations

Weak and strong interactions

Now the fast part of the generator splits the states into groups that do not communicate, and a slow part moves the chain between groups. Inside each group the distribution equilibrates almost at once. The weights of the groups follow a smaller Markov chain whose generator is an average of the slow rates.

The idea

Setup. Qε(t)=Q~(t)/ε+Q^(t)Q^\varepsilon(t)=\tilde Q(t)/\varepsilon+\hat Q(t) with Q~=diag(Q~1,…,Q~l)\tilde Q=\mathrm{diag}(\tilde Q^1,\dots,\tilde Q^l). Block Q~k\tilde Q^k acts on the group ℳk={sk1,…,skmk}\mathcal M_k=\{s_{k1},\dots,s_{km_k}\}, is weakly irreducible, and has quasi-stationary distribution νk(t)\nu^k(t). Q^(t)\hat Q(t) is any generator on all m=m1+⋯+mlm=m_1+\dots+m_l states.
Aggregated generator. With 𝟏~=diag(𝟏m1,…,𝟏ml)\tilde{\mathbf 1}=\mathrm{diag}(\mathbf 1_{m_1},\dots,\mathbf 1_{m_l}), an m×lm\times l matrix,
Q‾(t)=diag(ν1(t),…,νl(t))Q^(t)𝟏~.\bar Q(t)=\mathrm{diag}\big(\nu^1(t),\dots,\nu^l(t)\big)\,\hat Q(t)\,\tilde{\mathbf 1}.
Entry q‾kj\bar q_{kj} is the slow rate from group kk into group jj, averaged over the states of group kk with weights νk\nu^k.
Leading-order behaviour. Uniformly on [0,T][0,T],
pε(t)=(ϑ1(t)ν1(t),…,ϑl(t)νl(t))+ψ0(t/ε)+O(ε),p^\varepsilon(t)=\big(\vartheta_1(t)\nu^1(t),\dots,\vartheta_l(t)\nu^l(t)\big)+\psi_0(t/\varepsilon)+O(\varepsilon),
where ϑ=(ϑ1,…,ϑl)\vartheta=(\vartheta_1,\dots,\vartheta_l) solves ϑ′(t)=ϑ(t)Q‾(t)\vartheta'(t)=\vartheta(t)\bar Q(t) with ϑ(0)=p0𝟏~\vartheta(0)=p^0\tilde{\mathbf 1}, the vector of initial group weights. The initial layer ψ0(τ)=(p0−φ0(0))eQ~(0)τ\psi_0(\tau)=\big(p^0-\varphi_0(0)\big)e^{\tilde Q(0)\tau}, where φ0(0)=(ϑ1(0)ν1(0),…,ϑl(0)νl(0))\varphi_0(0)=(\vartheta_1(0)\nu^1(0),\dots,\vartheta_l(0)\nu^l(0)), decays exponentially.

So P(αε(t)∈ℳk)→ϑk(t)P(\alpha^\varepsilon(t)\in\mathcal M_k)\to\vartheta_k(t), and given the group, the chain is spread according to νk(t)\nu^k(t). The group weights have no zeroth-order layer: eQ~τe^{\tilde Q\tau} only moves probability inside groups, so ψ0(τ)𝟏~=0\psi_0(\tau)\tilde{\mathbf 1}=0.

What survives the limit. Q^\hat Q enters only through Q‾\bar Q. Slow rates between two states of the same group change nothing at leading order, and two slow generators with the same Q‾\bar Q give the same ϑ\vartheta.

Explore

Start
Dashed curves include ψ₀

Fast rates: s11→s12s_{11}\to s_{12} 2, s12→s11s_{12}\to s_{11} 1, s21→s22s_{21}\to s_{22} 1, s22→s21s_{22}\to s_{21} 3 (all divided by ε). Slow rates: s11→s21s_{11}\to s_{21} 0.9, s12→s22s_{12}\to s_{22} 0.3, s21→s12s_{21}\to s_{12} 0.4, s22→s11s_{22}\to s_{11} 1.2.

Solid: P(αε(t)=skj)P(\alpha^\varepsilon(t)=s_{kj}). Dashed: ϑk(t)νjk\vartheta_k(t)\nu^k_j, with or without the initial layer.
P(αε(t)∈ℳ1)P(\alpha^\varepsilon(t)\in\mathcal M_1) P(αε(t)∈ℳ2)P(\alpha^\varepsilon(t)\in\mathcal M_2); dashed: ϑ(t)\vartheta(t) from ϑ′=ϑQ‾\vartheta'=\vartheta\bar Q

Worked example

Compute everything the explorer uses: ν1,ν2\nu^1,\nu^2, Q‾\bar Q, and ϑ(t)\vartheta(t) when the chain starts in s11s_{11}. Then find the long-run distribution of the full chain to leading order.

  1. Find ν1\nu^1 and ν2\nu^2.

    For a two-state block with rates aa (first to second) and bb (back), ν=(b,a)/(a+b)\nu=(b,a)/(a+b). So ν1=(1,2)/3\nu^1=(1,2)/3 and ν2=(3,1)/4\nu^2=(3,1)/4.

  2. Compute q‾12\bar q_{12} and q‾21\bar q_{21}.

    q‾12=ν11⋅0.9+ν21⋅0.3=0.3+0.2=0.5\bar q_{12}=\nu^1_1\cdot0.9+\nu^1_2\cdot0.3=0.3+0.2=0.5 and q‾21=ν12⋅0.4+ν22⋅1.2=0.3+0.3=0.6\bar q_{21}=\nu^2_1\cdot0.4+\nu^2_2\cdot1.2=0.3+0.3=0.6. So

    Q‾=(−0.50.50.6−0.6).\bar Q=\begin{pmatrix}-0.5 & 0.5\\ 0.6 & -0.6\end{pmatrix}.
  3. Solve for ϑ(t)\vartheta(t) with ϑ(0)=(1,0)\vartheta(0)=(1,0).

    By the two-state formula from Module 1, ϑ1(t)=611+511e−1.1t\vartheta_1(t)=\tfrac6{11}+\tfrac5{11}e^{-1.1t} and ϑ2=1−ϑ1\vartheta_2=1-\vartheta_1.

  4. What is the stationary distribution of the full chain, to leading order in ε\varepsilon?

    Let t→∞t\to\infty in the leading term: ϑ→(611,511)\vartheta\to(\tfrac6{11},\tfrac5{11}), so

    νε≈(611⋅13, 611⋅23, 511⋅34, 511⋅14)=(211,411,1544,544).\nu^\varepsilon\approx\big(\tfrac6{11}\cdot\tfrac13,\ \tfrac6{11}\cdot\tfrac23,\ \tfrac5{11}\cdot\tfrac34,\ \tfrac5{11}\cdot\tfrac14\big)=\big(\tfrac2{11},\tfrac4{11},\tfrac{15}{44},\tfrac5{44}\big).

    A direct computation with ε=0.01\varepsilon=0.01 gives (0.1817,0.3637,0.3410,0.1136)(0.1817,0.3637,0.3410,0.1136), against (0.1818,0.3636,0.3409,0.1136)(0.1818,0.3636,0.3409,0.1136) here. The 4-state problem has been reduced to three 2-state problems: one for each group, and one for the aggregated chain.

Check your understanding

Group 1 has ν1=(12,12)\nu^1=(\tfrac12,\tfrac12). From s11s_{11} the slow rate into group 2 is 2; from s12s_{12} it is 0. What is q‾12\bar q_{12}?

  1. 2That is the rate from s11s_{11} only. The chain spends half of its group-1 time in s12s_{12}, where it cannot leave.
  2. 1
  3. 0, the smaller rateThe aggregated rate is an average, not a minimum.
q‾12=12⋅2+12⋅0=1\bar q_{12}=\tfrac12\cdot2+\tfrac12\cdot0=1. Because the fast chain visits both states many times between slow jumps, the slow clock sees the time-averaged exit rate.

In the right-hand plot the group probabilities show no fast transient at the start, even when the chain starts in a single state. Why?

  1. Q~\tilde Q is block diagonal, so the fast dynamics only move probability inside a group; each group's total changes at rate O(1)O(1).
  2. Because νk\nu^k sums to 1.That is true but says nothing about time evolution. What does eQ~τe^{\tilde Q\tau} do to the total mass of a group?
  3. They do have one, it is just too small to see.At leading order it is exactly zero: ψ0𝟏~=(p0−φ0(0))eQ~τ𝟏~=(p0−φ0(0))𝟏~=0\psi_0\tilde{\mathbf 1}=(p^0-\varphi_0(0))e^{\tilde Q\tau}\tilde{\mathbf 1}=(p^0-\varphi_0(0))\tilde{\mathbf 1}=0.
The initial layer reshuffles mass within each group toward νk\nu^k; the group totals ϑk\vartheta_k start at their correct values p0𝟏~p^0\tilde{\mathbf 1} and evolve slowly. (An O(ε)O(\varepsilon) layer can remain.)

What happens if Q^=0\hat Q=0?

  1. pε(t)p^\varepsilon(t) converges to a unique stationary distribution.With Q^=0\hat Q=0 the groups never communicate, so the chain is not irreducible.
  2. ϑ\vartheta stays at its initial value: the group weights are frozen, and inside each group the distribution tends to νk\nu^k.
  3. The theorem fails.It still applies, with Q‾=0\bar Q=0.
Q‾=0\bar Q=0 gives ϑ(t)=ϑ(0)\vartheta(t)=\vartheta(0). The weak interaction Q^\hat Q is what lets probability move between groups, on the slow time scale.

Practice

Q‾\bar Q is a generatorTwo lines

Show that Q‾=diag(ν1,…,νl)Q^𝟏~\bar Q=\mathrm{diag}(\nu^1,\dots,\nu^l)\hat Q\tilde{\mathbf 1} has nonnegative off-diagonal entries and zero row sums.

Solution

For k≠jk\neq j, q‾kj=∑iνik∑s∈ℳjq^ski,s≥0\bar q_{kj}=\sum_i\nu^k_i\sum_{s\in\mathcal M_j}\hat q_{s_{ki},s}\ge0, a nonnegative combination of off-diagonal entries of Q^\hat Q. Row sums: Q‾𝟏l=diag(νk)Q^𝟏~𝟏l=diag(νk)Q^𝟏m=0\bar Q\mathbf 1_l=\mathrm{diag}(\nu^k)\hat Q\tilde{\mathbf 1}\mathbf 1_l=\mathrm{diag}(\nu^k)\hat Q\mathbf 1_m=0.

Where Q‾\bar Q comes fromAveraging the forward equation

Multiply the forward equation pε′=pε(Q~/ε+Q^)p^{\varepsilon\prime}=p^\varepsilon(\tilde Q/\varepsilon+\hat Q) on the right by 𝟏~\tilde{\mathbf 1}. Assuming pε≈(ϑ1ν1,…,ϑlνl)p^\varepsilon\approx(\vartheta_1\nu^1,\dots,\vartheta_l\nu^l), derive ϑ′=ϑQ‾\vartheta'=\vartheta\bar Q.

Solution

Since Q~𝟏~=0\tilde Q\tilde{\mathbf 1}=0, the 1/ε1/\varepsilon term drops out: (pε𝟏~)′=pεQ^𝟏~(p^\varepsilon\tilde{\mathbf 1})'=p^\varepsilon\hat Q\tilde{\mathbf 1}. The left side is the vector of group weights, approximately ϑ\vartheta. On the right, (ϑ1ν1,…,ϑlνl)=ϑdiag(ν1,…,νl)(\vartheta_1\nu^1,\dots,\vartheta_l\nu^l)=\vartheta\,\mathrm{diag}(\nu^1,\dots,\nu^l), so the right side is ϑdiag(νk)Q^𝟏~=ϑQ‾\vartheta\,\mathrm{diag}(\nu^k)\hat Q\tilde{\mathbf 1}=\vartheta\bar Q.

InteractiveYin–Zhang, Ch. 4: Asymptotic Expansions of Solutions for Forward Equations

Transient and absorbing states

Add states that the fast dynamics leaves and never returns to. Their probability dies out within a time of order ε\varepsilon, and the mass they held is handed to the recurrent groups in proportions that one linear solve gives. Absorbing states are the simplest recurrent groups of all.

The idea

Setup. After relabelling, the fast generator has the form
Q~=(Q~1⋱Q~lQ~*1⋯Q~*lQ~*),\tilde Q=\begin{pmatrix}\tilde Q^1 & & & \\ & \ddots & & \\ & & \tilde Q^l & \\ \tilde Q^1_* & \cdots & \tilde Q^l_* & \tilde Q_*\end{pmatrix},
where each Q~k\tilde Q^k is a weakly irreducible generator on a recurrent group ℳk\mathcal M_k, the last block row belongs to the transient states ℳ*\mathcal M_*, and Q~*\tilde Q_* is Hurwitz: all its eigenvalues have negative real part. A group with one state and Q~k=(0)\tilde Q^k=(0) is an absorbing state, with νk=1\nu^k=1.
Exit probabilities. ak=−Q~*−1Q~*k𝟏mk∈ℝm*a_k=-\tilde Q_*^{-1}\tilde Q^k_*\mathbf 1_{m_k}\in\R^{m_*}. Its entry for a transient state ss is the probability that the fast chain started at ss first enters ℳk\mathcal M_k. Since Q~𝟏=0\tilde Q\mathbf 1=0, ∑kak=𝟏m*\sum_ka_k=\mathbf 1_{m_*}.
Leading order. pε(t)=(ϑ1(t)ν1,…,ϑl(t)νl, 0m*)+ψ0(t/ε)+O(ε)p^\varepsilon(t)=\big(\vartheta_1(t)\nu^1,\dots,\vartheta_l(t)\nu^l,\ 0_{m_*}\big)+\psi_0(t/\varepsilon)+O(\varepsilon), where
ϑk(0)=p0,k𝟏mk+p0,*ak,ϑ′=ϑQ‾*,Q‾*=diag(ν1,…,νl)(Q^11𝟏~+Q^12(a1,…,al)).\vartheta_k(0)=p^{0,k}\mathbf 1_{m_k}+p^{0,*}a_k,\qquad \vartheta'=\vartheta\bar Q_*,\qquad \bar Q_*=\mathrm{diag}(\nu^1,\dots,\nu^l)\big(\hat Q^{11}\tilde{\mathbf 1}+\hat Q^{12}(a_1,\dots,a_l)\big).
Here Q^11\hat Q^{11} holds the slow rates among recurrent states and Q^12\hat Q^{12} the slow rates from recurrent into transient states.

Read Q‾*\bar Q_* as a routing rule. A slow jump straight into another group counts as it is. A slow jump into a transient state is followed, within time O(ε)O(\varepsilon), by a fast exit into group kk with probability given by aka_k; only the part that lands in a different group is a real change of group.

Explore

Start

Recurrent group ℳ1={s11,s12}\mathcal M_1=\{s_{11},s_{12}\} (fast rates 1 and 2 between them), absorbing state ℳ2={s21}\mathcal M_2=\{s_{21}\}, transient states s1*,s2*s^*_1,s^*_2. Fast: s1*→s11s^*_1\to s_{11} 2, s1*→s2*s^*_1\to s^*_2 1, s2*→s1*s^*_2\to s^*_1 1, s2*→s12s^*_2\to s_{12} 0.5, s2*→s21s^*_2\to s_{21} 1. Slow: s11→s21s_{11}\to s_{21} 0.3, s12→s1*s_{12}\to s^*_1 0.4, s21→s2*s_{21}\to s^*_2 0.5.

P(ℳ1)P(\mathcal M_1) P(ℳ2)P(\mathcal M_2) P(ℳ*)P(\mathcal M_*); dashed: ϑ(t)\vartheta(t)
The start in stretched time τ=t/ε\tau=t/\varepsilon. Dashed: the predicted split ϑ(0)\vartheta(0).

Worked example

For the chain in the explorer, compute the exit probabilities a1,a2a_1,a_2 and the aggregated generator Q‾*\bar Q_*.

  1. Write Q~*\tilde Q_* and check that it is Hurwitz.

    On (s1*,s2*)(s^*_1,s^*_2): Q~*=(−311−2.5)\tilde Q_*=\begin{pmatrix}-3&1\\1&-2.5\end{pmatrix}. Its row sums are −2-2 and −1.5-1.5, so each diagonal entry outweighs the rest of its row and, by Gershgorin's theorem, every eigenvalue has negative real part. (They are ≈−1.72\approx-1.72 and −3.78-3.78.)

  2. Find h(s)=P(enter ℳ1 first|s)h(s)=P(\text{enter }\mathcal M_1\text{ first}\mid s) by a first-step argument.

    From s1*s^*_1: with probability 23\tfrac23 go straight to s11s_{11}, with 13\tfrac13 to s2*s^*_2. From s2*s^*_2: 0.52.5=15\tfrac{0.5}{2.5}=\tfrac15 to s12s_{12}, 25\tfrac25 to s21s_{21}, 25\tfrac25 to s1*s^*_1. So h1=23+13h2h_1=\tfrac23+\tfrac13h_2 and h2=15+25h1h_2=\tfrac15+\tfrac25h_1, giving h1=1113h_1=\tfrac{11}{13}, h2=713h_2=\tfrac7{13}. This is a1=−Q~*−1Q~*1𝟏a_1=-\tilde Q_*^{-1}\tilde Q^1_*\mathbf 1 written out; and a2=𝟏−a1=(213,613)a_2=\mathbf 1-a_1=(\tfrac2{13},\tfrac6{13}).

  3. Starting in s1*s^*_1, what is ϑ(0)\vartheta(0)?

    ϑ(0)=(1113,213)≈(0.846,0.154)\vartheta(0)=(\tfrac{11}{13},\tfrac2{13})\approx(0.846,0.154). The explorer's right panel shows the mass settling to these levels within a few multiples of ε\varepsilon.

  4. Compute q‾12\bar q_{12} and q‾21\bar q_{21}.

    ν1=(23,13)\nu^1=(\tfrac23,\tfrac13). From ℳ1\mathcal M_1: s11→s21s_{11}\to s_{21} is a direct change of group, weight 23⋅0.3=0.2\tfrac23\cdot0.3=0.2; s12→s1*s_{12}\to s^*_1 changes group only if the chain then exits to ℳ2\mathcal M_2, weight 13⋅0.4⋅213=0.839\tfrac13\cdot0.4\cdot\tfrac2{13}=\tfrac{0.8}{39}. So q‾12=43195≈0.2205\bar q_{12}=\tfrac{43}{195}\approx0.2205. From ℳ2\mathcal M_2: s21→s2*s_{21}\to s^*_2, then on to ℳ1\mathcal M_1 with probability 713\tfrac7{13}: q‾21=0.5⋅713=726≈0.2692\bar q_{21}=0.5\cdot\tfrac7{13}=\tfrac7{26}\approx0.2692.

Check your understanding

A transient state s*s^* has fast rate 3 into group 1 and fast rate 1 into group 2, and no other moves. The chain starts at s*s^*. What is ϑ(0)\vartheta(0)?

  1. (12,12)(\tfrac12,\tfrac12)The two exits are not equally likely: they race at rates 3 and 1.
  2. (34,14)(\tfrac34,\tfrac14)
  3. (3,1)(3,1)These are rates; ϑ(0)\vartheta(0) is a probability vector.
Q~*=(−4)\tilde Q_*=(-4), so a1=−(−4)−1⋅3=34a_1=-(-4)^{-1}\cdot3=\tfrac34 and a2=14a_2=\tfrac14: the first exit clock to ring decides.

Transient states have probability O(ε)O(\varepsilon) after the initial layer. Why not simply delete them and use diag(νk)Q^11𝟏~\mathrm{diag}(\nu^k)\hat Q^{11}\tilde{\mathbf 1} as the aggregated generator?

  1. That would be fine: states with vanishing probability cannot matter.Small probability is not the same as small flow. Slow jumps into transient states happen at rate O(1)O(1).
  2. Slow jumps into transient states happen at rate O(1)O(1), and a fraction of them end in a different group; dropping them loses real group changes.
  3. Because Q~*\tilde Q_* would no longer be invertible.Deleting the states removes Q~*\tilde Q_* altogether. The problem is what happens to Q‾\bar Q.
In the explorer, all slow movement from ℳ2\mathcal M_2 back to ℳ1\mathcal M_1 goes through s2*s^*_2. Delete the transient states and q‾21\bar q_{21} would be 0 instead of 7/267/26.

For t≫εt\gg\varepsilon, the total probability of the transient states is:

  1. exactly 0.The slow part keeps feeding the transient states.
  2. of order ε\varepsilon: fed at rate O(1)O(1) by slow jumps, drained at rate O(1/ε)O(1/\varepsilon).
  3. decaying like e−te^{-t}.The drain is fast, on the scale t/εt/\varepsilon, but the feed never stops.
A balance of flows: inflow ≈c\approx c per unit time, mean stay ≈ε/κ\approx\varepsilon/\kappa, so the mass is ≈cε/κ\approx c\varepsilon/\kappa. The explorer's "max P(transient) ÷ ε" stays roughly constant as you change ε.

Practice

Two absorbing statesA slow leak back

States 1 and 2 are absorbing for the fast part; state 3 is transient with fast rates 1 into state 1 and 2 into state 2. Slowly, state 1 jumps to 3 at rate b1b_1 and state 2 jumps to 3 at rate b2b_2. Find Q‾*\bar Q_* and the long-run fraction of time in state 1 as ε→0\varepsilon\to0.

Solution

a=(13,23)a=(\tfrac13,\tfrac23). From state 1, a slow jump leads to state 2 with probability 23\tfrac23: q‾12=23b1\bar q_{12}=\tfrac23b_1. Similarly q‾21=13b2\bar q_{21}=\tfrac13b_2. The stationary weight of state 1 is q‾21/(q‾12+q‾21)=b2/(2b1+b2)\bar q_{21}/(\bar q_{12}+\bar q_{21})=b_2/(2b_1+b_2).

The exit probabilities add upUsing the row sums

Show that ∑kak=𝟏m*\sum_ka_k=\mathbf 1_{m_*}.

Solution

The transient rows of Q~𝟏=0\tilde Q\mathbf 1=0 say ∑kQ~*k𝟏mk+Q~*𝟏m*=0\sum_k\tilde Q^k_*\mathbf 1_{m_k}+\tilde Q_*\mathbf 1_{m_*}=0. Multiply by −Q~*−1-\tilde Q_*^{-1}: ∑kak=−Q~*−1(−Q~*𝟏m*)=𝟏m*\sum_ka_k=-\tilde Q_*^{-1}\big(-\tilde Q_*\mathbf 1_{m_*}\big)=\mathbf 1_{m_*}. Starting from a transient state, the fast chain leaves ℳ*\mathcal M_* with probability 1.

SimulationYin–Zhang, Ch. 5: Occupation Measures: Asymptotic Properties and Ramification

Occupation measures and their fluctuations

The forward equation tells us P(αε(t)=i)P(\alpha^\varepsilon(t)=i). Applications usually need something about one path: how much time it actually spent in state ii. That time, minus its expected share, goes to zero like ε\sqrt\varepsilon, and divided by ε\sqrt\varepsilon it becomes Gaussian.

The idea

Occupation measure. For αε\alpha^\varepsilon generated by Q(t)/εQ(t)/\varepsilon (weakly irreducible), set
Oiε(t)=∫0t(I{αε(s)=i}−νi(s))ds,O^\varepsilon_i(t)=\int_0^t\big(I_{\{\alpha^\varepsilon(s)=i\}}-\nu_i(s)\big)\,ds,
or more generally with a bounded weight βi(s)\beta_i(s) inside the integral, as needed when a control multiplies the indicator.
Size. sup0≤t≤T⁡𝔼|Oε(t)|2=O(ε)\sup_{0\le t\le T}\mathbb E|O^\varepsilon(t)|^2=O(\varepsilon). There is also an exponential bound: for a small enough constant θ\theta (depending on TT), 𝔼exp⁡(θsupt≤T⁡|Oε(t)|/ε)\mathbb E\exp\big(\theta\sup_{t\le T}|O^\varepsilon(t)|/\sqrt\varepsilon\big) stays bounded as ε→0\varepsilon\to0. So large values of Oε/εO^\varepsilon/\sqrt\varepsilon are exponentially rare.
Central limit theorem. nε(t)=Oε(t)/εn^\varepsilon(t)=O^\varepsilon(t)/\sqrt\varepsilon converges weakly to a Gaussian process with independent increments, mean 0 and covariance ∫0tA(s)ds\int_0^tA(s)\,ds, where
Aij(t)=νi(t)∫0∞qij0(r,t)dr+νj(t)∫0∞qji0(r,t)dr,Q0(r,t)=eQ(t)r−𝟏ν(t).A_{ij}(t)=\nu_i(t)\int_0^\infty q^0_{ij}(r,t)\,dr+\nu_j(t)\int_0^\infty q^0_{ji}(r,t)\,dr,\qquad Q^0(r,t)=e^{Q(t)r}-\mathbf 1\nu(t).

For a constant QQ this is Aii=2νiZiiA_{ii}=2\nu_iZ_{ii}, with the deviation matrix Z=∫0∞(eQr−𝟏ν)dr=(𝟏ν−Q)−1−𝟏νZ=\int_0^\infty(e^{Qr}-\mathbf 1\nu)\,dr=(\mathbf 1\nu-Q)^{-1}-\mathbf 1\nu.

Why ε\sqrt\varepsilon. In time tt the fast chain goes through about t/εt/\varepsilon nearly independent cycles, each contributing a centered amount of size ε\varepsilon to OεO^\varepsilon. A sum of t/εt/\varepsilon such terms has standard deviation εt/ε=εt\varepsilon\sqrt{t/\varepsilon}=\sqrt{\varepsilon t}.

Explore

State i
ε

Generator Q/εQ/\varepsilon with Q=(−2112−3112−3)Q=\begin{pmatrix}-2&1&1\\2&-3&1\\1&2&-3\end{pmatrix}, so ν=(716,516,14)\nu=(\tfrac7{16},\tfrac5{16},\tfrac14). Time runs over [0,1][0,1].

24 paths of Oiε(t)O^\varepsilon_i(t). Note the vertical scale: it is set by ε\sqrt\varepsilon.
400 values of nε(1)n^\varepsilon(1) normal density, variance AA

Worked example

A two-state chain has rates λ/ε\lambda/\varepsilon (1→21\to2) and μ/ε\mu/\varepsilon (2→12\to1). Find the limiting variance of n1ε(t)n^\varepsilon_1(t), and use it to estimate the spread of the time spent in state 1 during [0,1][0,1] when λ=μ=1\lambda=\mu=1 and ε=0.01\varepsilon=0.01.

  1. What is p11(r)−ν1p_{11}(r)-\nu_1 for the unscaled generator?

    From Module 1, p11(r)=ν1+λλ+μe−(λ+μ)rp_{11}(r)=\nu_1+\frac{\lambda}{\lambda+\mu}e^{-(\lambda+\mu)r}, with ν1=μλ+μ\nu_1=\frac\mu{\lambda+\mu}.

  2. Compute Z11Z_{11}.

    Z11=∫0∞λλ+μe−(λ+μ)rdr=λ(λ+μ)2.Z_{11}=\int_0^\infty\frac{\lambda}{\lambda+\mu}e^{-(\lambda+\mu)r}\,dr=\frac{\lambda}{(\lambda+\mu)^2}.
  3. Find A11A_{11}.

    A11=2ν1Z11=2λμ(λ+μ)3.A_{11}=2\nu_1Z_{11}=\frac{2\lambda\mu}{(\lambda+\mu)^3}.

    Check against renewal theory: on and off periods with means 1/λ1/\lambda, 1/μ1/\mu and variances 1/λ21/\lambda^2, 1/μ21/\mu^2 give variance per unit time moff2σon2+mon2σoff2(mon+moff)3\frac{m_{\text{off}}^2\sigma_{\text{on}}^2+m_{\text{on}}^2\sigma_{\text{off}}^2}{(m_{\text{on}}+m_{\text{off}})^3}, which is the same expression.

  4. Now λ=μ=1\lambda=\mu=1, ε=0.01\varepsilon=0.01. How spread out is the time spent in state 1 during [0,1][0,1]?

    A=14A=\tfrac14, so VarO1ε(1)≈εA=0.0025\mathrm{Var}\,O^\varepsilon_1(1)\approx\varepsilon A=0.0025, a standard deviation of 0.05. The time in state 1 is 0.5±0.050.5\pm0.05 or so, even though the chain makes about 100 jumps. Fluctuations of order ε\sqrt\varepsilon are much larger than the O(ε)O(\varepsilon) errors of the forward equation.

Check your understanding

You divide ε\varepsilon by 4. The typical size of Oiε(1)O^\varepsilon_i(1) is:

  1. divided by 4.That is how the mean 𝔼Oε\mathbb EO^\varepsilon, of order ε\varepsilon, scales. The fluctuations are larger.
  2. divided by 2.
  3. unchanged.That is true of nε=Oε/εn^\varepsilon=O^\varepsilon/\sqrt\varepsilon, not of OεO^\varepsilon.
The standard deviation is ≈εA\approx\sqrt{\varepsilon A}. Step ε from 0.01 to 0.003 or so in the explorer and watch the vertical scale of the left panel.

Which statement about 𝔼Oiε(t)\mathbb EO^\varepsilon_i(t) and the typical value of |Oiε(t)||O^\varepsilon_i(t)| is right?

  1. Both are O(ε)O(\varepsilon).The mean is. A random quantity can be much larger than its mean in absolute value.
  2. The mean is O(ε)O(\varepsilon); the typical size is of order ε\sqrt\varepsilon.
  3. The mean is of order ε\sqrt\varepsilon.𝔼Oiε(t)=∫0t(piε(s)−νi(s))ds\mathbb EO^\varepsilon_i(t)=\int_0^t(p^\varepsilon_i(s)-\nu_i(s))\,ds, and Module 4 bounds the integrand by |ψ0(s/ε)|+O(ε)|\psi_0(s/\varepsilon)|+O(\varepsilon).
The mean comes from the forward equation: an initial layer of width ε\varepsilon and an O(ε)O(\varepsilon) outer error. The spread comes from the randomness of the path and is of order ε\sqrt\varepsilon. The explorer's sample mean of nε(1)n^\varepsilon(1) is close to 0.

The explorer starts each chain from ν\nu. If instead every chain started in state 1, would the limit of nε(1)n^\varepsilon(1) change?

  1. Yes: the mean would shift by an amount of order 1.How long does the effect of the starting state last, and how much does it contribute to OεO^\varepsilon?
  2. No: the starting state matters only for a time of order ε\varepsilon, which changes OεO^\varepsilon by O(ε)O(\varepsilon) and nεn^\varepsilon by O(ε)O(\sqrt\varepsilon).
This is why the theorem needs no assumption on p0p^0. The initial layer is invisible after the ε\sqrt\varepsilon scaling.

Practice

The deviation matrixA closed form

Let QQ be irreducible and Π=𝟏ν\Pi=\mathbf 1\nu. Show that ∫0∞(eQr−Π)dr=(Π−Q)−1−Π\int_0^\infty(e^{Qr}-\Pi)\,dr=(\Pi-Q)^{-1}-\Pi, and that this matrix ZZ satisfies Z𝟏=0Z\mathbf 1=0 and νZ=0\nu Z=0.

Hint

QΠ=ΠQ=0Q\Pi=\Pi Q=0 and Π2=Π\Pi^2=\Pi. Compute e(Q−Π)re^{(Q-\Pi)r}.

Solution

Since QQ and Π\Pi commute, e(Q−Π)r=eQre−Πr=eQr(I+(e−r−1)Π)=eQr+(e−r−1)Πe^{(Q-\Pi)r}=e^{Qr}e^{-\Pi r}=e^{Qr}\big(I+(e^{-r}-1)\Pi\big)=e^{Qr}+(e^{-r}-1)\Pi, using eQrΠ=Πe^{Qr}\Pi=\Pi. The eigenvalues of Q−ΠQ-\Pi are −1-1 (on 𝟏\mathbf 1) and the nonzero eigenvalues of QQ, all with negative real part, so ∫0∞e(Q−Π)rdr=(Π−Q)−1\int_0^\infty e^{(Q-\Pi)r}dr=(\Pi-Q)^{-1}. Hence ∫0∞(eQr−Π)dr=∫0∞(e(Q−Π)r−e−rΠ)dr=(Π−Q)−1−Π\int_0^\infty(e^{Qr}-\Pi)\,dr=\int_0^\infty\big(e^{(Q-\Pi)r}-e^{-r}\Pi\big)dr=(\Pi-Q)^{-1}-\Pi. Finally (eQr−Π)𝟏=0(e^{Qr}-\Pi)\mathbf 1=0 and ν(eQr−Π)=0\nu(e^{Qr}-\Pi)=0 for every rr.

A tail estimateUsing the Gaussian limit

With λ=μ=1\lambda=\mu=1 and ε=0.01\varepsilon=0.01 as in the worked example, estimate the probability that the chain spends more than 0.55 time units in state 1 during [0,1][0,1].

Solution

We need O1ε(1)>0.05O^\varepsilon_1(1)>0.05, i.e. n1ε(1)>0.5n^\varepsilon_1(1)>0.5. With limiting standard deviation 1/4=0.5\sqrt{1/4}=0.5, that is one standard deviation: probability ≈0.16\approx0.16.

SimulationYin–Zhang, Ch. 5: Occupation Measures: Asymptotic Properties and Ramification

The aggregated process

With weak and strong interactions, a single sample path splits into two parts. Which group the chain is in behaves more and more like a Markov chain with generator Q‾\bar Q. Where it is inside the group becomes a fast blur, whose time fractions are given by νk\nu^k.

The idea

Aggregated process. α‾ε(t)=k\bar\alpha^\varepsilon(t)=k when αε(t)∈ℳk\alpha^\varepsilon(t)\in\mathcal M_k. For fixed ε\varepsilon it is usually not Markov: how soon it leaves a group depends on the state inside the group.
Weak convergence. Under the assumptions of Module 5, α‾ε(⋅)\bar\alpha^\varepsilon(\cdot) converges weakly (in the space of right-continuous paths with left limits) to a Markov chain α‾(⋅)\bar\alpha(\cdot) generated by Q‾(t)\bar Q(t).
Occupation inside a group. For every state skjs_{kj}, uniformly in t≤Tt\le T,
𝔼(∫0t(I{αε(s)=skj}−νjk(s)I{α‾ε(s)=k})ds)2=O(ε).\mathbb E\Big(\int_0^t\big(I_{\{\alpha^\varepsilon(s)=s_{kj}\}}-\nu^k_j(s)\,I_{\{\bar\alpha^\varepsilon(s)=k\}}\big)\,ds\Big)^2=O(\varepsilon).
Time in skjs_{kj} is νjk\nu^k_j times time in ℳk\mathcal M_k, along each path, up to O(ε)O(\sqrt\varepsilon).

The centering uses the random indicator I{α‾ε=k}I_{\{\bar\alpha^\varepsilon=k\}}, not a deterministic function: the time spent in a group stays random in the limit, because α‾\bar\alpha itself is random. Scaled by 1/ε1/\sqrt\varepsilon, these occupation errors converge to a switching diffusion, a Brownian motion whose variance rate depends on the current value of α‾(t)\bar\alpha(t); its one-time distributions are Gaussian mixtures rather than Gaussian.

Explore

The four-state chain of Module 5: q‾12=0.5\bar q_{12}=0.5, q‾21=0.6\bar q_{21}=0.6, ν1=(13,23)\nu^1=(\tfrac13,\tfrac23), ν2=(34,14)\nu^2=(\tfrac34,\tfrac14).

Top: which state αε(t)\alpha^\varepsilon(t) is in (blue band: group ℳ1\mathcal M_1; gold band: ℳ2\mathcal M_2). Bottom: the group α‾ε(t)\bar\alpha^\varepsilon(t).

Worked example

In the explorer's chain, show that α‾ε\bar\alpha^\varepsilon is not a Markov chain for fixed ε\varepsilon, and explain why it becomes one in the limit.

  1. Through which states can the chain enter ℳ1\mathcal M_1?

    The slow moves into ℳ1\mathcal M_1 are s21→s12s_{21}\to s_{12} (rate 0.4) and s22→s11s_{22}\to s_{11} (rate 1.2). So it enters at s12s_{12} or at s11s_{11}, depending on where it was in ℳ2\mathcal M_2.

  2. Just after entering, what is the rate of leaving ℳ1\mathcal M_1?

    0.9 if it entered at s11s_{11}, 0.3 if at s12s_{12}. The future of α‾ε\bar\alpha^\varepsilon depends on more than its present value 1, so α‾ε\bar\alpha^\varepsilon is not Markov.

  3. How long does the chain remember its entry point?

    The block Q~1/ε\tilde Q^1/\varepsilon has nonzero eigenvalue −3/ε-3/\varepsilon. After a time of a few times ε/3\varepsilon/3 the position inside ℳ1\mathcal M_1 has distribution close to ν1\nu^1, whatever the entry point.

  4. What does a stay in ℳ1\mathcal M_1 look like in the limit?

    Over a stay of order 1, the exit rate is averaged against ν1\nu^1 and equals q‾12=13⋅0.9+23⋅0.3=0.5\bar q_{12}=\tfrac13\cdot0.9+\tfrac23\cdot0.3=0.5. The memory lasts only O(ε)O(\varepsilon), so stays become exponential with mean 2, independent of the past: the Markov property returns in the limit.

Check your understanding

On a fixed interval [0,T][0,T], as ε→0\varepsilon\to0:

  1. both the number of jumps and the number of group switches grow like 1/ε1/\varepsilon.Group switches are driven by Q^\hat Q, whose rates do not depend on ε\varepsilon.
  2. the number of jumps grows like 1/ε1/\varepsilon but the number of group switches stays of order 1.
  3. both stay of order 1.Inside a group the rates are of order 1/ε1/\varepsilon.
Compare the first two statistics in the explorer as you move ε: jumps explode, switches do not.

Why is time in skjs_{kj} compared with νjkI{α‾ε(s)=k}\nu^k_j\,I_{\{\bar\alpha^\varepsilon(s)=k\}} rather than with νjkϑk(s)\nu^k_j\vartheta_k(s)?

  1. The two give the same limit.∫0t(I{αε=skj}−νjkϑk)ds\int_0^t(I_{\{\alpha^\varepsilon=s_{kj}\}}-\nu^k_j\vartheta_k)\,ds does not go to 0: the time spent in ℳk\mathcal M_k is random even in the limit.
  2. The time the path spends in ℳk\mathcal M_k stays random as ε→0\varepsilon\to0, so only the split inside the group becomes deterministic.
  3. Because ϑk\vartheta_k is not known explicitly.It is: it solves ϑ′=ϑQ‾\vartheta'=\vartheta\bar Q. The issue is randomness, not computability.
Contrast Module 7: with a single irreducible group there is nothing slow left to be random, and the centering is deterministic.

When is α‾ε\bar\alpha^\varepsilon exactly a Markov chain for every ε\varepsilon?

  1. Never.It can be, under a condition on Q^\hat Q.
  2. When, for each pair of groups k≠jk\neq j, every state of ℳk\mathcal M_k has the same total slow rate into ℳj\mathcal M_j.
  3. When every Q~k\tilde Q^k is irreducible.The explorer's blocks are irreducible, and α‾ε\bar\alpha^\varepsilon still is not Markov there.
This is lumpability. Then the exit rate does not depend on the position inside the group, and α‾ε\bar\alpha^\varepsilon is Markov with generator Q‾\bar Q, for every ε\varepsilon.

Practice

Long-run time in one stateCombining the two scales

For the explorer's chain, find the limit as ε→0\varepsilon\to0 of the long-run fraction of time spent in s12s_{12}.

Solution

The aggregated chain spends a fraction q‾21/(q‾12+q‾21)=6/11\bar q_{21}/(\bar q_{12}+\bar q_{21})=6/11 of the time in ℳ1\mathcal M_1, and inside ℳ1\mathcal M_1 a fraction ν21=2/3\nu^1_2=2/3 is in s12s_{12}. Answer: 4/11≈0.3644/11\approx0.364, the same as in the worked example of Module 5.

Lumpability exactlyChecking the Markov property

Change the explorer's slow rates so that α‾ε\bar\alpha^\varepsilon becomes Markov for every ε\varepsilon while Q‾\bar Q stays the same.

Solution

Give both states of ℳ1\mathcal M_1 slow rate 0.5 into ℳ2\mathcal M_2 (say s11→s21s_{11}\to s_{21} at 0.5 and s12→s22s_{12}\to s_{22} at 0.5), and both states of ℳ2\mathcal M_2 rate 0.6 into ℳ1\mathcal M_1. The averages with ν1\nu^1 and ν2\nu^2 are still 0.5 and 0.6, and now the exit rate does not depend on the state inside the group.

Drag the payoffYin–Zhang, Ch. 6: Asymptotic Expansions of Solutions for Backward Equations

Backward equations and the terminal layer

An expected payoff collected at a final time TT solves the backward equation, which runs from TT back toward 0. The two-time-scale picture holds in reverse: a thin layer just before TT where values inside a group merge, then a slow evolution governed by the same Q‾\bar Q as before.

The idea

Backward equation. For a payoff vector ff (a column), the conditional expectations uε(t,i)=𝔼[f(αε(T))|αε(t)=i]u^\varepsilon(t,i)=\mathbb E\big[f(\alpha^\varepsilon(T))\mid\alpha^\varepsilon(t)=i\big] form the column vector uε(t)=Pε(T,t)fu^\varepsilon(t)=P^\varepsilon(T,t)f, which solves
duε(t)dt=−Qε(t)uε(t),uε(T)=f.\frac{du^\varepsilon(t)}{dt}=-Q^\varepsilon(t)\,u^\varepsilon(t),\qquad u^\varepsilon(T)=f.
A running reward gg adds −g(t)-g(t) to the right side.
Expansion. uε(t)=∑i≤nεiφi(t)+∑i≤nεiψi((T−t)/ε)+O(εn+1)u^\varepsilon(t)=\sum_{i\le n}\varepsilon^i\varphi_i(t)+\sum_{i\le n}\varepsilon^i\psi_i\big((T-t)/\varepsilon\big)+O(\varepsilon^{n+1}): an outer part, and a terminal layer in the stretched backward time τ=(T−t)/ε\tau=(T-t)/\varepsilon.
Leading terms (block-diagonal Q~\tilde Q, groups ℳk\mathcal M_k). φ0(t)=𝟏~u‾(t)\varphi_0(t)=\tilde{\mathbf 1}\,\bar u(t): constant on each group, with
du‾dt=−Q‾(t)u‾(t),u‾k(T)=νk(T)fk=∑jνjk(T)f(skj),\frac{d\bar u}{dt}=-\bar Q(t)\,\bar u(t),\qquad \bar u_k(T)=\nu^k(T)f^k=\sum_j\nu^k_j(T)f(s_{kj}),
and the terminal layer ψ0(τ)=eQ~(T)τ(f−𝟏~u‾(T))\psi_0(\tau)=e^{\tilde Q(T)\tau}\big(f-\tilde{\mathbf 1}\bar u(T)\big), which decays exponentially in τ\tau.

Duality. Forward equations act on row vectors (distributions), and the leading term has the form ϑdiag(νk)\vartheta\,\mathrm{diag}(\nu^k). Backward equations act on column vectors (functions), and the leading term has the form 𝟏~u‾\tilde{\mathbf 1}\bar u. In both, Q‾=diag(νk)Q^𝟏~\bar Q=\mathrm{diag}(\nu^k)\hat Q\tilde{\mathbf 1} governs the slow evolution. Value functions of control problems are backward objects, so Chapters 7 to 10 rest on this expansion.

Explore

Payoff presets:
Drag the four dots at t=Tt=T to set ff. s11s_{11} s12s_{12} s21s_{21} s22s_{22}; bands: u‾1,u‾2\bar u_1,\bar u_2
The terminal layer: the last 2.5ε2.5\,\varepsilon before TT, in units of ε\varepsilon. Dashed: 𝟏~u‾+ψ0\tilde{\mathbf 1}\bar u+\psi_0.

Worked example

Use the four-state chain of Module 5 with f=I{s11}f=I_{\{s_{11}\}}, so uε(t,i)=P(αε(T)=s11|αε(t)=i)u^\varepsilon(t,i)=P(\alpha^\varepsilon(T)=s_{11}\mid\alpha^\varepsilon(t)=i). Find the leading-order answer for tt well before TT.

  1. What does the terminal layer do to f=(1,0,0,0)f=(1,0,0,0)?

    Inside ℳ1\mathcal M_1, the values 1 and 0 merge into their ν1\nu^1-average 13⋅1+23⋅0=13\tfrac13\cdot1+\tfrac23\cdot0=\tfrac13; inside ℳ2\mathcal M_2 both are 0. So u‾(T)=(13,0)\bar u(T)=(\tfrac13,0).

  2. Solve du‾/dt=−Q‾u‾d\bar u/dt=-\bar Q\bar u backward from TT, writing s=T−ts=T-t.

    u‾(t)=eQ‾su‾(T)\bar u(t)=e^{\bar Qs}\bar u(T). With q‾12=0.5\bar q_{12}=0.5 and q‾21=0.6\bar q_{21}=0.6, the first column of eQ‾se^{\bar Qs} is 11.1(0.6+0.5e−1.1s, 0.6−0.6e−1.1s)\frac1{1.1}\big(0.6+0.5e^{-1.1s},\ 0.6-0.6e^{-1.1s}\big), so

    u‾1=13⋅0.6+0.5e−1.1s1.1,u‾2=13⋅0.6−0.6e−1.1s1.1.\bar u_1=\tfrac13\cdot\frac{0.6+0.5e^{-1.1s}}{1.1},\qquad \bar u_2=\tfrac13\cdot\frac{0.6-0.6e^{-1.1s}}{1.1}.
  3. What do both tend to as T−t→∞T-t\to\infty? Interpret.

    13⋅0.61.1=211≈0.182\tfrac13\cdot\tfrac{0.6}{1.1}=\tfrac2{11}\approx0.182, the long-run probability of s11s_{11} found in Module 5. Far from TT, the starting state is forgotten.

  4. Is there a terminal layer when ff is constant on each group, say f=(0,0,1,1)f=(0,0,1,1)?

    No: f−𝟏~u‾(T)=0f-\tilde{\mathbf 1}\bar u(T)=0, so ψ0=0\psi_0=0. The answer is P(α‾(T)=2|α‾(t)=k)P(\bar\alpha(T)=2\mid\bar\alpha(t)=k) to leading order. Try the "indicator of ℳ2\mathcal M_2" preset: the curves leave TT without any fast transient.

Check your understanding

Near t=Tt=T the values uε(t,s11)u^\varepsilon(t,s_{11}) and uε(t,s12)u^\varepsilon(t,s_{12}) differ. Going back from TT, how long until they agree to within 1%?

  1. A time of order ε\varepsilon (here about ε3ln⁡100\tfrac{\varepsilon}{3}\ln100).
  2. A time of order 1.The merging is done by the fast part Q~/ε\tilde Q/\varepsilon, not the slow part.
  3. They never agree: their payoffs differ.The payoffs differ only at TT. Starting slightly earlier, the chain has time to mix inside its group.
The difference is multiplied by e−3(T−t)/εe^{-3(T-t)/\varepsilon}, 3 being the mixing rate of block Q~1\tilde Q^1. Look at the zoomed panel.

Which average of the payoff over a group enters u‾(T)\bar u(T)?

  1. The plain average over the states of the group.States are not visited equally often by the fast chain.
  2. The νk\nu^k-weighted average ∑jνjkf(skj)\sum_j\nu^k_jf(s_{kj}).
  3. The value at the state the chain is in at time tt.That state is forgotten within a time of order ε\varepsilon.
At time TT the chain is, given its group, distributed close to νk\nu^k, whatever state it was in a little earlier.

Why is the boundary layer at TT for the backward equation, but at 0 for the forward equation?

  1. Each equation has a layer where its data are given: p0p^0 at time 0 for the forward equation, ff at time TT for the backward one.
  2. Because QεQ^\varepsilon changes fastest near TT.The layer appears even for constant generators. It is about the side condition.
  3. The backward equation has layers at both ends.Its condition is imposed only at TT; at t=0t=0 nothing has to be matched.
In both cases the data need not have the shape of the leading term (ϑdiag(νk)\vartheta\,\mathrm{diag}(\nu^k) or 𝟏~u‾\tilde{\mathbf 1}\bar u), and the layer is where the mismatch is absorbed.

Practice

A maximum principleBounds on expected payoffs

Show that mini⁡f(i)≤uε(t,j)≤maxi⁡f(i)\min_if(i)\le u^\varepsilon(t,j)\le\max_if(i) for all t≤Tt\le T and all jj, in two ways: probabilistically, and from the matrix form uε(t)=Pε(T,t)fu^\varepsilon(t)=P^\varepsilon(T,t)f.

Solution

Probabilistically, uε(t,j)u^\varepsilon(t,j) is an expectation of f(αε(T))f(\alpha^\varepsilon(T)), which lies between the min and max. In matrix form, each row of Pε(T,t)P^\varepsilon(T,t) is a probability vector, so uε(t,j)u^\varepsilon(t,j) is a convex combination of the f(i)f(i). In the explorer, no curve ever leaves the range of the four dots.

Probability of ending in a groupNo layer at all

For f=(0,0,1,1)f=(0,0,1,1) in the explorer's chain, find u‾(t)\bar u(t) and the leading-order value of uε(0,s11)u^\varepsilon(0,s_{11}) when T=3T=3.

Solution

u‾(T)=(0,1)\bar u(T)=(0,1), and u‾=eQ‾s(0,1)𝖳\bar u=e^{\bar Qs}(0,1)^{\mathsf T} with s=T−ts=T-t: u‾1=0.5−0.5e−1.1s1.1\bar u_1=\frac{0.5-0.5e^{-1.1s}}{1.1}, u‾2=0.5+0.6e−1.1s1.1\bar u_2=\frac{0.5+0.6e^{-1.1s}}{1.1}. At t=0t=0, s=3s=3 and e−3.3≈0.0369e^{-3.3}\approx0.0369, so uε(0,s11)≈0.5⋅0.96311.1≈0.438u^\varepsilon(0,s_{11})\approx\frac{0.5\cdot0.9631}{1.1}\approx0.438.

CalculatorYin–Zhang, Ch. 7: Markov Decision Problems

Markov decision problems on two time scales

When a controller can change the rates, the optimal cost solves a dynamic-programming equation on the full state space. On two time scales, a smaller problem with one state per group gets the value right to within O(ε)O(\varepsilon), and its decisions give a policy that is nearly optimal for the original problem.

The idea

The problem. The generator depends on an action: Qε(u)=Q~(u)/ε+Q^(u)Q^\varepsilon(u)=\tilde Q(u)/\varepsilon+\hat Q(u), with Q~(u)\tilde Q(u) block diagonal as before. A stationary feedback policy picks an action u(i)∈Γu(i)\in\Gamma in each state. Its cost is
Jε(i,u)=𝔼∫0∞e−ρtG(αε(t),u(αε(t)))dt,αε(0)=i,J^\varepsilon(i,u)=\mathbb E\int_0^\infty e^{-\rho t}\,G\big(\alpha^\varepsilon(t),u(\alpha^\varepsilon(t))\big)\,dt,\qquad \alpha^\varepsilon(0)=i,
and vε(i)=minu⁡Jε(i,u)v^\varepsilon(i)=\min_uJ^\varepsilon(i,u). For a fixed policy, Jε=(ρI−Qε(u))−1G(u)J^\varepsilon=(\rho I-Q^\varepsilon(u))^{-1}G(u).
Dynamic programming. ρvε(i)=mina∈Γ⁡{G(i,a)+∑j≠iqijε(a)(vε(j)−vε(i))}.\displaystyle\rho\,v^\varepsilon(i)=\min_{a\in\Gamma}\Big\{G(i,a)+\sum_{j\neq i}q^\varepsilon_{ij}(a)\big(v^\varepsilon(j)-v^\varepsilon(i)\big)\Big\}.
Limit problem. Its states are the groups. In group kk a decision is a whole tuple Uk=(uk1,…,ukmk)U^k=(u^{k1},\dots,u^{km_k}), one action per state of the group. It fixes the fast block Q~k(Uk)\tilde Q^k(U^k) and hence its quasi-stationary distribution νk(Uk)\nu^k(U^k), which gives the averaged cost and rates
G‾(k,Uk)=∑jνjk(Uk)G(skj,ukj),Q‾(U)=diag(ν1(U1),…,νl(Ul))Q^(U)𝟏~.\bar G(k,U^k)=\sum_j\nu^k_j(U^k)\,G(s_{kj},u^{kj}),\qquad \bar Q(U)=\mathrm{diag}\big(\nu^1(U^1),\dots,\nu^l(U^l)\big)\,\hat Q(U)\,\tilde{\mathbf 1}.
Let v(k)v(k) be the optimal value of this ll-state problem.
Asymptotic optimality. vε(i)→v(k)v^\varepsilon(i)\to v(k) for i∈ℳki\in\mathcal M_k. With finitely many actions, vε(i)−v(k)=O(ε)v^\varepsilon(i)-v(k)=O(\varepsilon), and the policy uc(skj)=u*kju_c(s_{kj})=u^{kj}_* read off an optimal limit decision satisfies Jε(i,uc)−vε(i)=O(ε)J^\varepsilon(i,u_c)-v^\varepsilon(i)=O(\varepsilon).

Explore

s₁₁fast (÷ε): →s₁₂: 2 / 1slow: →s₂₁: 0.2 / 0.05cost rate: 0 / 2
Your action
s₁₂fast (÷ε): →s₁₁: 1 / 3slow: →s₂₂: 1 / 0.5cost rate: 1 / 4
Your action
s₂₁fast (÷ε): →s₂₂: 1 / 1slow: →s₁₁: 0.1 / 1cost rate: 4 / 6.5
Your action
s₂₂fast (÷ε): →s₂₁: 2 / 4slow: →s₁₂: 0.3 / 1.5cost rate: 6 / 7.5
Your action

Each entry reads action 0 / action 1. Group ℳ1={s11,s12}\mathcal M_1=\{s_{11},s_{12}\} is the cheap regime, ℳ2\mathcal M_2 the expensive one. Action 1 ("maintain") costs more; it slows the drift into ℳ2\mathcal M_2 or speeds the return. Discount rate ρ=0.5\rho=0.5.

Solid: optimal vεv^\varepsilon for s11s_{11} s12s_{12} s21s_{21} s22s_{22}. Dashed: your policy. Dotted lines: the limit values v(1),v(2)v(1),v(2). ε is on a log scale. Every value is computed exactly by a linear solve.

Worked example

Solve the explorer's limit problem for the decision U1=(0,1)U^1=(0,1), U2=(0,1)U^2=(0,1), and compare it with U1=(0,0)U^1=(0,0), U2=(0,1)U^2=(0,1).

  1. With U1=(0,1)U^1=(0,1), what are ν1\nu^1, G‾(1)\bar G(1) and q‾12\bar q_{12}?

    Fast rates: s11→s12s_{11}\to s_{12} at 2, s12→s11s_{12}\to s_{11} at 3, so ν1=(35,25)\nu^1=(\tfrac35,\tfrac25). Then G‾(1)=35⋅0+25⋅4=1.6\bar G(1)=\tfrac35\cdot0+\tfrac25\cdot4=1.6 and q‾12=35⋅0.2+25⋅0.5=0.32\bar q_{12}=\tfrac35\cdot0.2+\tfrac25\cdot0.5=0.32.

  2. Same for group 2 with U2=(0,1)U^2=(0,1).

    s21→s22s_{21}\to s_{22} at 1, s22→s21s_{22}\to s_{21} at 4, so ν2=(45,15)\nu^2=(\tfrac45,\tfrac15), G‾(2)=45⋅4+15⋅7.5=4.7\bar G(2)=\tfrac45\cdot4+\tfrac15\cdot7.5=4.7 and q‾21=45⋅0.1+15⋅1.5=0.38\bar q_{21}=\tfrac45\cdot0.1+\tfrac15\cdot1.5=0.38.

  3. Solve ρv=G‾+Q‾v\rho v=\bar G+\bar Qv.

    0.82v1−0.32v2=1.60.82v_1-0.32v_2=1.6 and −0.38v1+0.88v2=4.7-0.38v_1+0.88v_2=4.7. The determinant is 0.82⋅0.88−0.32⋅0.38=0.60.82\cdot0.88-0.32\cdot0.38=0.6, so

    v1=1.6⋅0.88+0.32⋅4.70.6≈4.853,v2=0.82⋅4.7+0.38⋅1.60.6≈7.437.v_1=\frac{1.6\cdot0.88+0.32\cdot4.7}{0.6}\approx4.853,\qquad v_2=\frac{0.82\cdot4.7+0.38\cdot1.6}{0.6}\approx7.437.
  4. Now try U1=(0,0)U^1=(0,0) with the same U2U^2. Is it better?

    ν1=(13,23)\nu^1=(\tfrac13,\tfrac23), G‾(1)=23\bar G(1)=\tfrac23, q‾12=13⋅0.2+23⋅1=1115≈0.733\bar q_{12}=\tfrac13\cdot0.2+\tfrac23\cdot1=\tfrac{11}{15}\approx0.733. Solving gives v=(5.00,7.50)v=(5.00,7.50): cheaper to run, but the chain drifts into the expensive group more than twice as fast. Checking all 16 decisions shows (0,1),(0,1)(0,1),(0,1) is optimal, so uc=(0,1,0,1)u_c=(0,1,0,1), and the explorer confirms it is exactly optimal for the full problem once ε≲0.4\varepsilon\lesssim0.4.

Check your understanding

Why is a decision in the limit problem a whole tuple UkU^k, one action per state of the group, rather than a single action for the group?

  1. Different states of the group can use different actions, and the mix determines νk\nu^k, hence both G‾\bar G and Q‾\bar Q.
  2. Because the limit problem has more states than the original.It has fewer: one per group.
  3. A single action per group would give the same value.Not here: the optimal uc=(0,1,0,1)u_c=(0,1,0,1) uses both actions in each group.
The controller still sees the fast state, so it can act differently in each one. In the limit the effect of that local policy is summarised by νk(Uk)\nu^k(U^k).

At ε=1\varepsilon=1 the optimal policy is (0,0,1,1)(0,0,1,1), not uc=(0,1,0,1)u_c=(0,1,0,1). Does this contradict the theorem?

  1. Yes: ucu_c should be optimal.The theorem promises near-optimality as ε→0\varepsilon\to0, not optimality at a given ε\varepsilon.
  2. No: the theorem says Jε(uc)−vε=O(ε)J^\varepsilon(u_c)-v^\varepsilon=O(\varepsilon), which at ε=1\varepsilon=1 allows a visible gap.
At ε=1\varepsilon=1 the "fast" moves are not fast and the chain does not mix inside a group, so the averaging behind the limit problem is rough. In the explorer the gap vanishes once ε\varepsilon is below about 0.4.

As ε→0\varepsilon\to0, vε(s11)−vε(s12)→0v^\varepsilon(s_{11})-v^\varepsilon(s_{12})\to0, although the running costs in those states differ. Why?

  1. Because the optimal actions in the two states are equal.In the limit policy they are not: 0 in s11s_{11}, 1 in s12s_{12}.
  2. The chain moves between s11s_{11} and s12s_{12} within a time of order ε\varepsilon, so the starting state affects the cost only over a time of order ε\varepsilon.
  3. Because discounting makes all values equal.The values of the two groups stay different, about 4.85 and 7.44.
So vε(i)v^\varepsilon(i) depends at leading order only on the group of ii, which is why the limit problem has one state per group.

Practice

Discounted costs are averagesThe resolvent

Show that (ρI−Q)−1=∫0∞e−ρteQtdt(\rho I-Q)^{-1}=\int_0^\infty e^{-\rho t}e^{Qt}\,dt for a generator QQ and ρ>0\rho>0. Conclude that it has nonnegative entries with row sums 1/ρ1/\rho, so ρJ\rho J is a weighted average of running costs.

Solution

e−ρteQt=e(Q−ρI)te^{-\rho t}e^{Qt}=e^{(Q-\rho I)t}, and ddte(Q−ρI)t=(Q−ρI)e(Q−ρI)t\frac{d}{dt}e^{(Q-\rho I)t}=(Q-\rho I)e^{(Q-\rho I)t}. Integrating over [0,∞)[0,\infty) (the integrand decays since eQte^{Qt} is stochastic) gives (Q−ρI)∫0∞e(Q−ρI)tdt=−I(Q-\rho I)\int_0^\infty e^{(Q-\rho I)t}dt=-I. Entries are nonnegative because eQte^{Qt} is, and row sums are ∫0∞e−ρtdt=1/ρ\int_0^\infty e^{-\rho t}dt=1/\rho.

The long-run average cost of ucu_cLetting ρ → 0

In the limit, what is the long-run average cost per unit time of the policy ucu_c in the explorer?

Solution

The aggregated chain under ucu_c has q‾12=0.32\bar q_{12}=0.32, q‾21=0.38\bar q_{21}=0.38, so it spends fractions 0.380.70\tfrac{0.38}{0.70} and 0.320.70\tfrac{0.32}{0.70} of the time in the two groups. The average cost is 0.38⋅1.6+0.32⋅4.70.70=2.1120.70≈3.017\tfrac{0.38\cdot1.6+0.32\cdot4.7}{0.70}=\tfrac{2.112}{0.70}\approx3.017.

SimulationYin–Zhang, Ch. 8: Stochastic Control of Dynamical Systems

Production planning with an unreliable machine

A machine breaks down and is repaired at random, and its output must meet a steady demand. A good policy keeps a safety stock, the hedging point. When breakdowns and repairs are fast compared with the time scale of the costs, the right safety stock is of order ε\varepsilon, and the problem reduces to a deterministic one in which the machine has its average capacity.

The idea

Controlled system. A state xε(t)∈ℝnx^\varepsilon(t)\in\R^n driven by a two-time-scale chain: x˙ε=f(xε,αε(t),u(t))\dot x^\varepsilon=f(x^\varepsilon,\alpha^\varepsilon(t),u(t)), with u(t)∈Γu(t)\in\Gamma chosen from the past of αε\alpha^\varepsilon, and cost Jε=𝔼∫0∞e−ρtG(xε(t),αε(t),u(t))dtJ^\varepsilon=\mathbb E\int_0^\infty e^{-\rho t}G(x^\varepsilon(t),\alpha^\varepsilon(t),u(t))\,dt (or over a finite horizon). The book assumes ff affine in uu, GG convex, and Q~\tilde Q block diagonal with irreducible blocks.
Limit problem. Take one irreducible fast block, for simplicity. A limit control is a tuple U=(u1,…,um)U=(u^1,\dots,u^m), one control per machine state, and everything is averaged against ν\nu:
x˙=∑iνif(x,i,ui),cost ∫0∞e−ρt∑iνiG(x,i,ui)dt.\dot x=\sum_i\nu_i\,f(x,i,u^i),\qquad \text{cost }\int_0^\infty e^{-\rho t}\sum_i\nu_i\,G(x,i,u^i)\,dt.
With several groups, the averaging is done within each group, and the limit system still switches between groups according to Q‾\bar Q.
Near optimality. The value functions converge: |vε(x,α)−v0(x)|≤K(1+|x|κ)ε|v^\varepsilon(x,\alpha)-v^0(x)|\le K(1+|x|^\kappa)\sqrt\varepsilon for α\alpha in the group. A control built from a limit control U(t)U(t) as uε(t)=∑iI{αε(t)=i}ui(t)u^\varepsilon(t)=\sum_iI_{\{\alpha^\varepsilon(t)=i\}}u^i(t) is asymptotically optimal. The occupation-measure bounds of Module 7 are what make the comparison work.

The example. One machine, up or down: breakdown rate λ/ε\lambda/\varepsilon, repair rate μ/ε\mu/\varepsilon. Surplus (inventory minus backlog) x˙=u−z\dot x=u-z, with 0≤u≤k0\le u\le k when up and u=0u=0 when down; cost c+x++c−x−c^+x^++c^-x^- per unit time, long-run average. A hedging-point policy with level θ\theta produces at full rate below θ\theta, exactly zz at θ\theta, and nothing above. This is the classical setting where such policies are known to be optimal.

Average capacity is kμ/(λ+μ)k\mu/(\lambda+\mu), and the limit problem is a reliable machine of that capacity. If that exceeds zz, the limit plan keeps x=0x=0 forever at zero cost.

Explore

λ=1, μ=2\lambda=1,\ \mu=2 (up two thirds of the time), capacity k=3k=3, demand z=1.5z=1.5, inventory cost c+=1c^+=1, backlog cost c−=5c^-=5.

The surplus x(t)x(t), starting from 0. Shaded: machine down.
exact J(θ)J(\theta) your θ\theta best θ*\theta^*. Ring: J(θ)J(\theta) estimated by simulation.

Worked example

Find the long-run behaviour of the surplus under a hedging-point policy, the optimal θ\theta, and how it scales with ε\varepsilon. Assume kμ/(λ+μ)>zk\mu/(\lambda+\mu)>z.

  1. Which levels does xx visit in the long run, and with which velocities?

    Once below θ\theta, xx never goes above it. Up and below θ\theta: x˙=k−z>0\dot x=k-z>0. Up at θ\theta: x˙=0\dot x=0. Down: x˙=−z\dot x=-z. So the stationary law lives on (−∞,θ](-\infty,\theta], with an atom at θ\theta (machine up and waiting).

  2. Let fup(x),fdown(x)f_{\rm up}(x),f_{\rm down}(x) be the stationary densities below θ\theta. Why is (k−z)fup=zfdown(k-z)f_{\rm up}=z\,f_{\rm down}, and what form must they have?

    In equilibrium the net flow of probability across any level x<θx<\theta is zero: mass crosses upward at rate (k−z)fup(x)(k-z)f_{\rm up}(x) and downward at rate zfdown(x)z f_{\rm down}(x). The balance equation for the up state, ddx[(k−z)fup]=−λεfup+μεfdown\frac{d}{dx}\big[(k-z)f_{\rm up}\big]=-\frac\lambda\varepsilon f_{\rm up}+\frac\mu\varepsilon f_{\rm down}, then gives f∝eβ(x−θ)f\propto e^{\beta(x-\theta)} with

    β=1ε(μz−λk−z)>0.\beta=\frac1\varepsilon\Big(\frac\mu z-\frac\lambda{k-z}\Big)>0.

    So x−θx-\theta has a law that does not depend on θ\theta: an atom at 0 and an exponential tail of mean depth of order 1/β1/\beta, proportional to ε\varepsilon.

  3. Differentiate J(θ)=𝔼h(θ+Y)J(\theta)=\mathbb E\,h(\theta+Y), where Y=x−θY=x-\theta and h(x)=c+x++c−x−h(x)=c^+x^++c^-x^-. What is the optimality condition?

    Since the law of YY is free of θ\theta, J′(θ)=𝔼h′(θ+Y)=c+P(x>0)−c−P(x<0)J'(\theta)=\mathbb E\,h'(\theta+Y)=c^+P(x>0)-c^-P(x<0) (xx has no atom at 0 when θ>0\theta>0). So at the optimum

    P(x<0)=c+c++c−,P(x<0)=\frac{c^+}{c^++c^-},

    a "critical fractile": backlog should occur a fraction 1/61/6 of the time with c+=1, c−=5c^+=1,\ c^-=5.

  4. With the explorer's numbers, find θ*\theta^*.

    β=1ε(21.5−11.5)=23ε\beta=\frac1\varepsilon\big(\tfrac2{1.5}-\tfrac1{1.5}\big)=\frac2{3\varepsilon}. Normalising the densities and the atom shows P(x<θ)=23P(x<\theta)=\tfrac23 for every θ\theta and ε\varepsilon, so P(x<0)=23e−βθP(x<0)=\tfrac23e^{-\beta\theta}. Setting this to 16\tfrac16: e−βθ=14e^{-\beta\theta}=\tfrac14, so

    θ*=ln⁡4β=1.5εln⁡4≈2.08ε.\theta^*=\frac{\ln4}{\beta}=1.5\,\varepsilon\ln4\approx2.08\,\varepsilon.

    Both θ*\theta^* and the optimal cost are proportional to ε\varepsilon, and tend to the limit problem's answers, 0 and 0.

Check your understanding

Keep θ=1\theta=1 fixed and let ε→0\varepsilon\to0. What does the long-run cost J(1)J(1) tend to?

  1. 0, the value of the limit problem.Only if θ\theta shrinks too. With θ=1\theta=1 you keep one unit of stock.
  2. c+⋅1=1c^+\cdot1=1: excursions below θ\theta are only O(ε)O(\varepsilon) deep, so x≈1x\approx1 nearly all the time.
  3. ∞\infty.The average capacity exceeds demand, so the surplus is stable for every θ\theta.
Set θ=1\theta=1 in the explorer and slide ε down: the cost at the gold dot approaches 1 while the minimum of the curve slides toward θ=0\theta=0.

In the limit problem, why does the capacity enter only through kνup=kμ/(λ+μ)k\nu_{\rm up}=k\mu/(\lambda+\mu)?

  1. Because the planner should prepare for the worst case, capacity 0.Worst-case planning would ignore that the machine is up most of the time.
  2. The machine state switches so fast that production averages out: over any interval of order 1 it is up a fraction νup\nu_{\rm up} of the time.
  3. Because the policy produces at full speed kk all the time.It cannot produce when the machine is down.
The dynamics are linear in uu, so ∫(u−z)dt\int(u-z)\,dt depends on the path of αε\alpha^\varepsilon only through occupation times, which concentrate at ν\nu (Module 7).

In the explorer, doubling ε\varepsilon doubles θ*\theta^*. Why?

  1. Down periods last O(ε)O(\varepsilon), so the dips below θ\theta are O(ε)O(\varepsilon) deep, and the safety stock that guards against them scales the same way.
  2. Because the cost rates c±c^\pm are proportional to ε\varepsilon.The cost rates do not change with ε\varepsilon.
  3. It is a coincidence of these parameter values.It holds for any parameters: the whole stationary law of x−θx-\theta is a rescaling by ε\varepsilon.
Rescaling time by ε\varepsilon maps the problem with parameter ε\varepsilon onto the one with ε=1\varepsilon=1, with xx scaled by ε\varepsilon. Watch "θ* ÷ ε" in the stats: it is always 1.5ln⁡4≈2.0791.5\ln4\approx2.079.

Practice

When is the surplus stable?The sign of β

Show that β>0\beta>0 exactly when the average capacity exceeds demand, kμ/(λ+μ)>zk\mu/(\lambda+\mu)>z. What happens to the surplus otherwise?

Solution

εβ=μ(k−z)−λzz(k−z)\varepsilon\beta=\frac{\mu(k-z)-\lambda z}{z(k-z)}, and μ(k−z)−λz>0⟺μk>(λ+μ)z\mu(k-z)-\lambda z>0\iff\mu k>(\lambda+\mu)z. If the inequality fails, the average drift below θ\theta, νup(k−z)−νdownz=νupk−z\nu_{\rm up}(k-z)-\nu_{\rm down}z=\nu_{\rm up}k-z, is ≤0\le0; the surplus drifts to −∞-\infty (or is null recurrent at equality) and the long-run cost is infinite.

The limit problem from a backlogA deterministic plan

In the limit problem with the explorer's numbers, start from x(0)=−2x(0)=-2 and ignore discounting over the transient. What is the optimal plan, how long does it take to clear the backlog, and what does it cost?

Solution

Produce at the full average rate kνup=2k\nu_{\rm up}=2 until x=0x=0: x˙=0.5\dot x=0.5, so it takes 4 time units. Then hold x=0x=0, producing z/νup=2.25≤3z/\nu_{\rm up}=2.25\le3 whenever the machine is up. The cost is c−∫04(2−t/2)dt=5⋅4=20c^-\int_0^4(2-t/2)\,dt=5\cdot4=20.

SimulationYin–Zhang, Ch. 9: Numerical Methods for Control and Optimization

Tuning a threshold by stochastic approximation

When the cost of a threshold policy has no formula, simulate it. A stochastic-approximation recursion uses noisy estimates of the slope of the cost, taken from short simulated runs, and walks the threshold toward the optimum. Here it is on the machine of Module 11, where the exact answer is known, so you can see how well it does.

The idea

Solving the HJB equation numerically. One route to an optimal control is to discretise the dynamic-programming (HJB) equation on a grid of mesh Δ\Delta, replacing each derivative by a one-sided difference taken in the direction of the drift. The discrete equations are themselves the dynamic-programming equations of a controlled Markov chain on the grid, and their solutions converge to the value function as Δ→0\Delta\to0 (in the viscosity sense).
Threshold policies. Often the control is of threshold type with parameters θ\theta: the action depends only on which side of some levels the state lies, as with the hedging point. The long-run average cost J(θ)J(\theta) becomes a function of finitely many numbers, to be minimised.
Stochastic approximation. Update θn+1=θn−ηgn\theta_{n+1}=\theta_n-\eta\,g_n, where gng_n is an estimate of ∇J(θn)\nabla J(\theta_n) computed from the simulated system over the nn-th time window. Here, with window length WW and a small δ\delta,
gn=J^n(θn+δ)−J^n(θn−δ)2δ,g_n=\frac{\hat J_n(\theta_n+\delta)-\hat J_n(\theta_n-\delta)}{2\delta},
where J^n\hat J_n is the time-average cost over the window. Both runs use the same machine history (common random numbers): it does not depend on θ\theta, so only the effect of the policy differs.
ODE method. Interpolate the iterates in time steps of η\eta. As η→0\eta\to0 the interpolated path converges weakly to the solution of θ˙=−∇J(θ)\dot\theta=-\nabla J(\theta) (up to the bias of the gradient estimate), and over long times it concentrates near a stable point θ*\theta^* of that ODE. With a constant step the iterates keep fluctuating around θ*\theta^*; the fluctuations shrink as η\eta does.

Explore

Step size η
Window W
Common random numbers

The machine of Module 11 with ε=1\varepsilon=1; finite-difference step δ=0.25\delta=0.25. Each step simulates the next window of length WW twice, at θn+δ\theta_n+\delta and at θn−δ\theta_n-\delta, continuing from where the previous window ended.

θn\theta_n exact θ*\theta^*
Exact J(θ)J(\theta), with the last 30 iterates (darker is more recent).
Press Run. With η = 0.3 and W = 20 the iterates reach θ* = 2.08 within a few dozen steps and then jitter around it (on average slightly to the right, where J is flatter; that offset shrinks with η). Turn common random numbers off: the two cost estimates now have independent noise, the slope estimates become much noisier, and the iterates wander, mostly into the flat region to the right of θ*. A short window W = 5 also makes each slope estimate noisier. A smaller η is steadier but slower.

Worked example

The finite difference has its own bias: even with perfect cost estimates, the recursion settles where the difference quotient vanishes, not where J′J' does. Compute that point for the explorer's machine (ε=1\varepsilon=1).

  1. From Module 11, write J′(θ)J'(\theta) for θ>0\theta>0.

    J′(θ)=c+−(c++c−)P(x<0)=1−6⋅23e−βθ=1−4e−βθJ'(\theta)=c^+-(c^++c^-)P(x<0)=1-6\cdot\tfrac23e^{-\beta\theta}=1-4e^{-\beta\theta}, with β=23\beta=\tfrac23.

  2. For θ≥δ\theta\ge\delta, compute the exact central difference J(θ+δ)−J(θ−δ)2δ\frac{J(\theta+\delta)-J(\theta-\delta)}{2\delta}.

    Integrate J′J' over [θ−δ,θ+δ][\theta-\delta,\theta+\delta] and divide by 2δ2\delta:

    J(θ+δ)−J(θ−δ)2δ=1−4e−βθsinh⁡βδβδ.\frac{J(\theta+\delta)-J(\theta-\delta)}{2\delta}=1-4e^{-\beta\theta}\,\frac{\sinh\beta\delta}{\beta\delta}.
  3. Where does it vanish?

    At e−βθ=14⋅βδsinh⁡βδe^{-\beta\theta}=\tfrac14\cdot\frac{\beta\delta}{\sinh\beta\delta}, i.e.

    θδ=θ*+1βln⁡sinh⁡βδβδ≈θ*+βδ26.\theta_\delta=\theta^*+\frac1\beta\ln\frac{\sinh\beta\delta}{\beta\delta}\approx\theta^*+\frac{\beta\delta^2}{6}.
  4. Evaluate the bias for δ=0.25\delta=0.25 and δ=1\delta=1.

    δ=0.25\delta=0.25: βδ=16\beta\delta=\tfrac16, bias ≈0.0069\approx0.0069, invisible next to the noise. δ=1\delta=1: βδ=23\beta\delta=\tfrac23, sinh⁡(23)/23≈1.0757\sinh(\tfrac23)/\tfrac23\approx1.0757, bias ≈1.5ln⁡1.0757≈0.109\approx1.5\ln1.0757\approx0.109. A large δ\delta gives quieter estimates but a biased answer: the usual trade-off of finite differences.

Check your understanding

Why run θn+δ\theta_n+\delta and θn−δ\theta_n-\delta on the same machine history?

  1. Otherwise the gradient estimate would be biased.Independent runs give an estimate with the same mean. The difference is in its variance.
  2. The noise in the two cost estimates is then largely shared and cancels in the difference, so the slope estimate has much smaller variance.
  3. To save simulation time.Both runs still have to be simulated; only the machine history is shared.
Var(J^+−J^−)=VarJ^++VarJ^−−2Cov\mathrm{Var}(\hat J_+-\hat J_-)=\mathrm{Var}\hat J_++\mathrm{Var}\hat J_--2\,\mathrm{Cov}, and sharing the randomness makes the covariance large. Toggle it off in the explorer and compare.

With a constant step size η\eta, what do the iterates do in the long run?

  1. Converge to θ*\theta^* exactly.Each step adds noise of size η×\eta\,\times (noise in gng_n), which never stops.
  2. Fluctuate in a neighbourhood of θ*\theta^* whose size shrinks as η→0\eta\to0.
  3. Drift away, because the noise accumulates.Near θ*\theta^* the mean step −ηJ′(θ)-\eta J'(\theta) pulls them back.
To converge exactly you need decreasing steps, typically ∑nηn=∞\sum_n\eta_n=\infty and ∑nηn2<∞\sum_n\eta_n^2<\infty. A constant step can track a slowly changing optimum, which decreasing steps cannot.

Which ODE describes the iterates for small η\eta, ignoring the finite-difference bias?

  1. θ˙=−J′(θ)\dot\theta=-J'(\theta), the gradient flow of the long-run cost.
  2. θ˙=−J^n′(θ)\dot\theta=-\hat J_n'(\theta), with the noisy estimates.In the limit the noise averages out; the ODE involves only its mean.
  3. θ˙=−J(θ)\dot\theta=-J(\theta).The recursion moves against the slope, not against the cost itself.
Over a stretch of 1/η1/\eta iterations, many independent windows are averaged. This is the same averaging idea as in the two-time-scale chains: here the "fast" variable is the simulated system and the "slow" one is θ\theta.

Practice

A pathwise derivativeNo finite differences needed

Start the surplus at x(0)=θx(0)=\theta and keep the machine history fixed. Show that xθ(t)−θx_\theta(t)-\theta does not depend on θ\theta, and derive the unbiased slope estimate 1W∫0W(c+I{x(t)>0}−c−I{x(t)<0})dt\frac1W\int_0^W\big(c^+I_{\{x(t)>0\}}-c^-I_{\{x(t)<0\}}\big)\,dt for ddθJ^\frac{d}{d\theta}\hat J.

Solution

The dynamics of y=x−θy=x-\theta involve only yy and the machine state (full speed when y<0y<0, match demand at y=0y=0), and y(0)=0y(0)=0. So xθ(t)=θ+y(t)x_\theta(t)=\theta+y(t) with yy free of θ\theta. Then J^(θ)=1W∫0Wh(θ+y(t))dt\hat J(\theta)=\frac1W\int_0^Wh(\theta+y(t))\,dt, and differentiating under the integral gives 1W∫0Wh′(x(t))dt\frac1W\int_0^Wh'(x(t))\,dt, which is the formula. This is infinitesimal perturbation analysis; it uses one run instead of two.

A Markov chain approximationDiscretising a drift

For x˙=b\dot x=b with constant bb, build a continuous-time chain on the grid Δℤ\Delta\Z with the right mean drift and a variance per unit time that vanishes as Δ→0\Delta\to0.

Solution

Jump x→x+Δx\to x+\Delta at rate b+/Δb^+/\Delta and x→x−Δx\to x-\Delta at rate b−/Δb^-/\Delta. The mean drift is Δ(b+−b−)/Δ=b\Delta(b^+-b^-)/\Delta=b and the variance per unit time is Δ2|b|/Δ=|b|Δ→0\Delta^2|b|/\Delta=|b|\Delta\to0. With the machine state added, the grid chain jumps also as α\alpha does, and its DP equation is the upwind discretisation of the HJB equation.

InteractiveYin–Zhang, Ch. 10: Hybrid LQG Problems

LQ control with Markov switching

A linear system whose coefficients switch with a Markov chain is best controlled by a linear feedback whose gain depends on the current regime. The gains come from coupled Riccati equations, one per state of the chain. On two time scales, they collapse to one averaged Riccati equation per group.

The idea

Hybrid LQG problem. dx=(A(α(t))x+B(α(t))u)dt+σdwdx=\big(A(\alpha(t))x+B(\alpha(t))u\big)dt+\sigma\,dw on [s,T][s,T], with α\alpha independent of the Brownian motion ww, and cost
J=𝔼[∫sT(x𝖳M(α)x+u𝖳N(α)u)dt+x(T)𝖳Dx(T)],J=\mathbb E\Big[\int_s^T\big(x^{\mathsf T}M(\alpha)x+u^{\mathsf T}N(\alpha)u\big)\,dt+x(T)^{\mathsf T}Dx(T)\Big],
with M(i)≥0M(i)\ge0 and N(i),D>0N(i),D>0.
Coupled Riccati equations. The value is v(s,x,i)=x𝖳K(s,i)x+q(s,i)v(s,x,i)=x^{\mathsf T}K(s,i)x+q(s,i), where for each state ii
K˙i=−KiAi−Ai𝖳Ki−Mi+KiBiNi−1Bi𝖳Ki−∑jqijKj,Ki(T)=D,\dot K_i=-K_iA_i-A_i^{\mathsf T}K_i-M_i+K_iB_iN_i^{-1}B_i^{\mathsf T}K_i-\sum_{j}q_{ij}K_j,\qquad K_i(T)=D,
and the optimal control is u=−Ni−1Bi𝖳Kixu=-N_i^{-1}B_i^{\mathsf T}K_i\,x in regime ii. The term ∑jqijKj=∑j≠iqij(Kj−Ki)\sum_jq_{ij}K_j=\sum_{j\neq i}q_{ij}(K_j-K_i) is the generator acting on the value function: it accounts for future switches.
Two-time-scale limit. With qij=qijεq_{ij}=q^\varepsilon_{ij} from Q~/ε+Q^\tilde Q/\varepsilon+\hat Q, Kε(s,skj)→K‾(s,k)K^\varepsilon(s,s_{kj})\to\bar K(s,k) for every state of group kk, where K‾\bar K solves the Riccati system of the averaged problem:
K‾˙k=−K‾kA‾k−A‾k𝖳K‾k−M‾k+K‾kBN−1B𝖳kK‾k−∑lq‾klK‾l,\dot{\bar K}_k=-\bar K_k\bar A_k-\bar A_k^{\mathsf T}\bar K_k-\bar M_k+\bar K_k\,\overline{BN^{-1}B^{\mathsf T}}_k\,\bar K_k-\sum_l\bar q_{kl}\bar K_l,
each bar being a νk\nu^k-average over the group. The control uε=−N−1(αε)B𝖳(αε)K‾(t,α‾ε(t))xu^\varepsilon=-N^{-1}(\alpha^\varepsilon)B^{\mathsf T}(\alpha^\varepsilon)\bar K(t,\bar\alpha^\varepsilon(t))\,x is nearly optimal: its cost approaches the optimal one as ε→0\varepsilon\to0.

Only the Riccati part is shared within a group. The feedback still uses the BB and NN of the current state.

Explore

Scalar system, the four-state chain of Module 5. a=(1.2,−0.6,0.5,−1)a=(1.2,-0.6,0.5,-1), b=(1,0.5,1.5,1)b=(1,0.5,1.5,1), m=n=1m=n=1, D=0.5D=0.5, T=3T=3. Averages: a‾=(0, 0.125)\bar a=(0,\ 0.125), b2=(0.5, 1.9375)\overline{b^2}=(0.5,\ 1.9375).

Thin lines: Kε(t,i)K^\varepsilon(t,i) for the four states. Wide bands: K‾(t,1)\bar K(t,1) (blue) and K‾(t,2)\bar K(t,2) (gold).
maxt,i⁡|Kε−K‾|\max_{t,i}|K^\varepsilon-\bar K| against ε\varepsilon, log–log; dashed: slope 1. Gold dot: the current ε.
The four Riccati equations are integrated backward from K(T)=DK(T)=D. With ε large they spread out, each regime pricing its own dynamics; as ε shrinks the two states of each group are pulled together by the 1/ε1/\varepsilon coupling, and the pair follows the averaged equation. The error falls along the slope-1 line: it is O(ε)O(\varepsilon). Note state s11s_{11} alone is unstable (a=1.2a=1.2), but its group averages to a‾=0\bar a=0.

Worked example

A scalar system switches very fast between two regimes, a1=2a_1=2 and a2=−1a_2=-1, spending fractions ν=(13,23)\nu=(\tfrac13,\tfrac23) of the time in them; b=m=n=1b=m=n=1 in both, D=0D=0. Find the limiting Riccati solution and its long-horizon gain, and check the closed loop.

  1. Write the scalar Riccati equations for the two regimes.

    K˙i=−2aiKi−1+Ki2−1ε∑jq~ijKj\dot K_i=-2a_iK_i-1+K_i^2-\frac1\varepsilon\sum_{j}\tilde q_{ij}K_j, Ki(T)=0K_i(T)=0.

  2. Why are K1K_1 and K2K_2 nearly equal for small ε\varepsilon?

    The coupling term 1εq~12(K2−K1)\frac1\varepsilon\tilde q_{12}(K_2-K_1) is huge unless K1≈K2K_1\approx K_2. Any difference is damped at rate O(1/ε)O(1/\varepsilon), so K1−K2=O(ε)K_1-K_2=O(\varepsilon).

  3. Average the two equations with weights ν\nu to get an equation for the common value K‾\bar K.

    The 1/ε1/\varepsilon terms cancel because νQ~=0\nu\tilde Q=0. What remains is K‾˙=−2a‾K‾−1+K‾2\dot{\bar K}=-2\bar a\bar K-1+\bar K^2 with a‾=13⋅2+23⋅(−1)=0\bar a=\tfrac13\cdot2+\tfrac23\cdot(-1)=0: K‾˙=K‾2−1\dot{\bar K}=\bar K^2-1, K‾(T)=0\bar K(T)=0. Its solution is K‾(t)=tanh⁡(T−t)\bar K(t)=\tanh(T-t).

  4. Far from TT the gain is K‾≈1\bar K\approx1, so u≈−xu\approx-x. Is the closed loop stable?

    In regime 1 the closed loop is x˙=(2−1)x=x\dot x=(2-1)x=x, unstable on its own. In regime 2 it is x˙=−2x\dot x=-2x. With fast switching, x(t)≈x(0)exp⁡∫0t(a(αε(s))−1)ds≈x(0)e(a‾−1)t=x(0)e−tx(t)\approx x(0)\exp\int_0^t(a(\alpha^\varepsilon(s))-1)\,ds\approx x(0)e^{(\bar a-1)t}=x(0)e^{-t}: stable. The averaged design stabilises the switched system though it would not stabilise regime 1 alone.

Check your understanding

Where does the term ∑jqijKj\sum_jq_{ij}K_j in the Riccati equation for regime ii come from?

  1. From the Brownian noise σdw\sigma\,dw.The noise only enters the equation for q(s,i)q(s,i), through tr(σσ𝖳Ki)\mathrm{tr}(\sigma\sigma^{\mathsf T}K_i).
  2. From the chance of switching to regime jj: it is the generator of α\alpha acting on the value function x𝖳K(s,⋅)xx^{\mathsf T}K(s,\cdot)x.
  3. From the terminal cost DD.DD enters only through the terminal condition.
In the HJB equation the chain contributes ∑j≠iqij(v(s,x,j)−v(s,x,i))\sum_{j\neq i}q_{ij}\big(v(s,x,j)-v(s,x,i)\big). With v=x𝖳Kx+qv=x^{\mathsf T}K x+q this is x𝖳(∑jqijKj)x+…x^{\mathsf T}\big(\sum_jq_{ij}K_j\big)x+\dots, since ∑jqij=0\sum_jq_{ij}=0.

In the nearly optimal feedback uε=−N−1(αε)B𝖳(αε)K‾(t,α‾ε)xu^\varepsilon=-N^{-1}(\alpha^\varepsilon)B^{\mathsf T}(\alpha^\varepsilon)\bar K(t,\bar\alpha^\varepsilon)x, which part no longer depends on the state inside the group?

  1. K‾\bar K, the Riccati solution; BB and NN are still those of the current state.
  2. All of it: the feedback depends only on the group.The controller still knows the current state and uses its BB and NN.
  3. None of it.The Riccati part is shared within a group, as the explorer shows.
If BB and NN happen to be the same within each group, the whole feedback depends only on the group. Otherwise only the value-function part is shared.

To form the averaged equation, a student averages bb first and then squares: (∑jνjbj)2/n(\sum_j\nu_jb_j)^2/n. What is wrong?

  1. Nothing; it gives the same answer.In the explorer's group 2, (0.75⋅1.5+0.25⋅1)2=1.89(0.75\cdot1.5+0.25\cdot1)^2=1.89, while 0.75⋅2.25+0.25⋅1=1.940.75\cdot2.25+0.25\cdot1=1.94.
  2. The control enters the cost quadratically, so the right average is b2/n=∑jνjbj2/nj\overline{b^2/n}=\sum_j\nu_jb_j^2/n_j, which is larger by Jensen's inequality.
  3. One should average KK instead of the coefficients.KK is the unknown being solved for; the coefficients are what get averaged.
In each state the best control removes bj2K2/njb_j^2K^2/n_j from the cost rate, and the fast chain averages those reductions. Equivalently, the limit control is a tuple U=(uk1,…)U=(u^{k1},\dots) and the averaged control effect is ∑jνjBjukj\sum_j\nu_jB_ju^{kj}.

Practice

From HJB to RiccatiThe scalar case

For a scalar system with one regime, substitute v=K(s)x2+q(s)v=K(s)x^2+q(s) into 0=vs+minu⁡{(ax+bu)vx+mx2+nu2}+12σ2vxx0=v_s+\min_u\{(ax+bu)v_x+mx^2+nu^2\}+\tfrac12\sigma^2v_{xx} and derive the equations for KK and qq.

Solution

The minimum over uu is at u=−bvx/(2n)=−bKx/nu=-bv_x/(2n)=-bKx/n, with minimum value axvx+mx2−b2K2x2/naxv_x+mx^2-b^2K^2x^2/n. Matching the x2x^2 terms: K˙+2aK+m−b2K2/n=0\dot K+2aK+m-b^2K^2/n=0; the constant terms: q˙+σ2K=0\dot q+\sigma^2K=0. Terminal conditions K(T)=DK(T)=D, q(T)=0q(T)=0.

The long-horizon gainAn algebraic Riccati equation

For one scalar regime, find the limit of K(t)K(t) as T−t→∞T-t\to\infty, and check it against the worked example.

Solution

Set K˙=0\dot K=0: b2nK2−2aK−m=0\frac{b^2}nK^2-2aK-m=0, whose positive root is K=nb2(a+a2+b2m/n)K=\frac{n}{b^2}\Big(a+\sqrt{a^2+b^2m/n}\Big). With a=0a=0 and b=m=n=1b=m=n=1, K=1K=1, the limit of tanh⁡(T−t)\tanh(T-t). The closed loop rate is a−b2K/n=−a2+b2m/n<0a-b^2K/n=-\sqrt{a^2+b^2m/n}<0: always stable.