Averaging by hand

A fast two-state switch worked by hand: the average, the variance of the fluctuations, and the memory of the start.

One small model shows what the averaged answer is, why it is only approximately right, and where the first corrections come from. Each correction has a plain meaning.

A quantity driven by a fast switch

Suppose a quantity accumulates at a rate that depends on a hidden switch. The switch $y_t$ flips between two states, 1 and 2, and it leaves each state at rate $\lambda$.

While the switch is in state $i$, the quantity grows at rate $g_i$. After time $t$ the accumulated amount is

$$I_t = \int_0^t g(y_s)\,ds .$$

Think of $g$ as a negative interest rate, or minus a default intensity. The quantity we want is the expectation of its exponential,

$$a_i(t) = \mathbb{E}\big[e^{I_t} \mid y_0 = i\big],$$

which is a bond price or a survival probability. When $\lambda$ is large the switch flips many times before time $t$.

The averaged answer

A switch that flips very often spends half its time in each state. Over any stretch much longer than $1/\lambda$, the rate $g(y_s)$ therefore averages to

$$\bar g = \tfrac12\,(g_1 + g_2).$$

This is the law of large numbers applied to time averages. It gives the averaged answer

$$a_i(t) \approx e^{\bar g\,t}.$$

The averaged answer forgets the starting state, and it forgets that the switch is random. Both omissions matter at order $1/\lambda$, and each has a simple explanation.

First correction: the integral fluctuates

The integral $I_t$ is not equal to $\bar g\,t$. It is a sum of many short, nearly independent pieces, so by the central limit theorem it is approximately normal around $\bar g\,t$. For a normal variable,

$$\mathbb{E}\big[e^{I}\big] = e^{\mathbb{E}[I] + \frac12\operatorname{Var}(I)} .$$

So the fluctuations raise the answer by half the variance of the integral.

The variance comes from how long the switch remembers its state. Write $\tilde g = \tfrac12(g_1 - g_2)$ for the half-difference, so that $g(y) - \bar g = \pm\tilde g$. The fluctuation $g(y_s) - \bar g$ forgets itself at rate $2\lambda$:

$$\operatorname{Cov}\big(g(y_s),\, g(y_{s+\tau})\big) = \tilde g^{\,2}\,e^{-2\lambda\tau}.$$

Integrating this over a long time gives

$$\operatorname{Var}(I_t) \approx 2t\int_0^\infty \tilde g^{\,2}\,e^{-2\lambda\tau}\,d\tau = \frac{t\,\tilde g^{\,2}}{\lambda}.$$

Half of that is the first correction to the exponent:

$$\log a_i(t) \approx \bar g\,t + \frac{t\,\tilde g^{\,2}}{2\lambda} .$$

The correction is the same for both starting states. It grows with $t$, and it is always positive, because randomness in the rate raises the expectation of an exponential.

First correction: the switch remembers where it started

A switch that starts in state 1 is more likely to be in state 1 for a short while. The excess probability of being in state 1 decays like $e^{-2\lambda s}$. Over the whole path this shifts the integral by

$$\mathbb{E}\big[I_t \mid y_0 = 1\big] - \bar g\,t \approx \int_0^\infty \tilde g\,e^{-2\lambda s}\,ds = \frac{\tilde g}{2\lambda}.$$

Starting in state 2 shifts it by the same amount in the other direction. So the answer carries a factor

$$e^{\pm\tilde g/(2\lambda)} \approx 1 \pm \frac{\tilde g}{2\lambda} .$$

The first-order formula

With $\varepsilon = 1/\lambda$, the two corrections combine into

$$a_i(t) \approx \exp\Big(\bar g\,t + \frac{\varepsilon}{2}\,\tilde g^{\,2}\,t\Big)\,\Big(1 \pm \frac{\varepsilon}{2}\,\tilde g\Big).$$

When the rates change over time, as they do in bond pricing, $g_i$ becomes a function $g_i(t)$ and the products with $t$ become integrals:

$$a_i(t) \approx \exp\Big(\int_0^t \bar g + \frac{\varepsilon}{2}\int_0^t \tilde g^{\,2}\Big)\,\Big(1 \pm \frac{\varepsilon}{2}\,\tilde g(t)\Big).$$

This is the first-order formula used on the regime-switching page and in every example. The shared term is the variance of the fluctuations. The regime-dependent bracket is the memory of the starting state.

Higher orders

The heuristic above explains the first corrections, but it does not produce the higher ones. For those the expectation is written as the solution of a differential equation, and the equation is expanded in powers of $\varepsilon$. Two ideas make that expansion work.

The engine page puts these together into one recursion that produces every order.