Regime-Switching Liquidity: Stationary Distribution and Spell Length

Stochastic Processes · Medium · Free problem

Liquidity alternates between two regimes -- Good ($G$) and Bad ($B$) -- in discrete one-minute steps. The transition probabilities are:

  • $P(G \to B) = 0.10$ (probability of switching from Good to Bad in one step)
  • $P(B \to G) = 0.30$ (probability of switching from Bad to Good in one step)

So the chain stays in $G$ with probability $0.90$ and stays in $B$ with probability $0.70$.

  1. Compute the stationary probability of being in the Bad regime.
  1. Given that you just entered the Bad regime (i.e., you transitioned from $G$ to $B$ this minute), what is the expected number of consecutive minutes you spend in $B$ before returning to $G$?

Hints

  1. For a two-state Markov chain, the stationary distribution has a simple closed-form in terms of the two transition probabilities. Think about what "balance" means: flow into a state equals flow out.
  2. The stationary probability of state $B$ is $\pi_B = \frac{P(G \to B)}{P(G \to B) + P(B \to G)}$. For the spell length, think about what distribution governs the time until the first transition out of $B$.
  3. The sojourn time in $B$ is geometric with parameter $P(B \to G) = 0.30$. Its expectation is the reciprocal of the exit probability.

Worked Solution

How to Think About It: This is a two-state Markov chain, one of the most common building blocks in quant finance. Regime-switching models like this show up everywhere -- market microstructure, volatility modeling, credit risk. The two questions test the two most fundamental things you need to know about any Markov chain: where does it spend its time in the long run (stationary distribution), and how long does it stay in a given state once it arrives (sojourn time).

Quick Estimate: The chain leaves $G$ with probability $0.10$ and leaves $B$ with probability $0.30$, so $B$ is "stickier" than you might expect but $G$ is much stickier. Intuitively, the chain spends more time in $G$ because it is harder to leave $G$ than to leave $B$. Rough mental math: the ratio of time in $G$ to time in $B$ should be proportional to $P(B \to G) / P(G \to B) = 0.30 / 0.10 = 3$. So the chain spends about 3 times as much time in $G$ as in $B$, giving $\pi_B \approx 1/4 = 0.25$. For the spell length: you leave $B$ each minute with probability $0.30$, so a $B$-spell lasts about

/0.30 \approx 3.3$ minutes.

Approach: Use the balance equations for the stationary distribution and the geometric distribution for the sojourn time.

Formal Solution:

*Part (i): Stationary probability of $B$*

For a two-state chain with states $G$ and $B$, the stationary distribution $(\pi_G, \pi_B)$ satisfies the balance equation:

$\pi_G \cdot P(G \to B) = \pi_B \cdot P(B \to G)$

Substituting:

$\pi_G \cdot 0.10 = \pi_B \cdot 0.30$

So $\pi_G = 3\pi_B$. Combined with $\pi_G + \pi_B = 1$:

$3\pi_B + \pi_B = 1 \implies \pi_B = \frac{1}{4} = 0.25$

Equivalently, for a two-state chain the stationary probability of state $B$ is:

$\pi_B = \frac{P(G \to B)}{P(G \to B) + P(B \to G)} = \frac{0.10}{0.10 + 0.30} = \frac{1}{4}$

*Part (ii): Expected length of a $B$-spell*

Once you enter $B$, each subsequent minute you either stay in $B$ (with probability $0.70$) or transition to $G$ (with probability $0.30$). The number of minutes spent in $B$ before leaving follows a Geometric distribution with "success" probability $q = P(B \to G) = 0.30$, where the first minute (the one where you entered $B$) counts as part of the spell.

The expected sojourn time is:

$E[\text{spell length}] = \frac{1}{P(B \to G)} = \frac{1}{0.30} = \frac{10}{3} \approx 3.33 \text{ minutes}$

Note: this uses the convention that the geometric random variable counts the trial on which you first leave, so the minimum spell length is 1 minute.

Answer:

  1. The stationary probability of being in the Bad regime is $\pi_B = \frac{1}{4} = 0.25$.
  1. The expected length of a consecutive $B$-spell is $\frac{1}{0.30} = \frac{10}{3} \approx 3.33$ minutes.

Intuition

This problem illustrates the two most fundamental facts about finite-state Markov chains. First, the stationary distribution depends only on the ratio of transition rates between states -- the chain spends time in each state proportional to how hard it is to leave that state relative to the other. For two states, this boils down to the formula $\pi_B = P(G \to B) / (P(G \to B) + P(B \to G))$, which is just the "arrival rate into $B

Loading problems...
quot; divided by the "total switching rate." Second, sojourn times (how long you stay in a state once you arrive) are always geometric for discrete-time chains, with expected length equal to the reciprocal of the exit probability.

In practice, regime-switching models like this are workhorses in market microstructure and volatility modeling. A market maker might use exactly this setup to estimate how long a bad-liquidity episode lasts on average, which directly feeds into spread-widening logic or inventory management. The key practical takeaway: even though the chain is in the Bad regime 25% of the time, each individual Bad spell is short (about 3.3 minutes on average). The Bad regime is frequent but brief -- a pattern that matters a lot for how you manage risk around it.

Open the full interactive solver →