A process with a one-step memory
A Markov chain moves between a finite set of states, and the next state depends only on the current one: P(Xt+1=j∣Xt=i, earlier history)=Pij. The whole model is the transition matrix P, whose rows are probability distributions (each row sums to 1). Markets are often described as switching between regimes such as calm and turbulent, or bull and bear, and a Markov chain is the simplest model of that switching.
P(n)=Pn,πP=π,i∑πi=1(1) The n-step transition probabilities are the entries of the matrix power Pn, which is matrix multiplication of the previous linear algebra topics at work. A stationary distribution π satisfies πP=π: if the chain starts with it, it keeps it forever. For a chain in which every state can reach every other (irreducible) and that does not cycle with a fixed period (aperiodic), the stationary distribution is unique and the chain converges to it from any start; πi is the long-run fraction of time spent in state i. The time spent in a state before leaving is geometric with mean 1/(1−Pii).
A bull and bear marketLet the daily state be bull (B) or bear (R) with
P=(0.90.20.10.8). Two days ahead,
P2=(0.830.340.170.66): starting in a bull market, the chance of a bear market two days later is 0.17. The stationary distribution solves
0.1πB=0.2πR, so
π=(2/3, 1/3): in the long run the market spends two thirds of the time in the bull state. A bull regime lasts on average
1/(1−0.9)=10 days.
- Markov property: the next state depends only on the current state.
- n steps: use Pn. Stationary: solve πP=π with the entries adding to 1.
- Duration: a state with self-transition p lasts 1/(1−p) steps on average.
Regimes are modelled, not observedA real market never announces its regime. A fitted Markov chain gives you probabilities of switching, but you must infer the current regime from returns. When the state is hidden, the model becomes a hidden Markov model, treated in a later skill. Estimated transition probabilities are themselves noisy, so durations such as 10 days carry wide uncertainty.
Lab · what's graded
- Two-day transitions20 pts
- The stationary distribution15 pts
- How long a regime lasts15 pts
- From bull to bear in two days10 pts
- The Markov property15 pts
- When it converges10 pts
- What the stationary distribution means15 pts