Overview

11 Predicting future states with Markov analysis

This chapter introduces Markov analysis as a way to predict how a system’s state will evolve using only its current condition and fixed transition probabilities. Leveraging the Markov property (memorylessness), it frames real-world problems—such as market-share churn and credit delinquency—in terms of discrete states and the likelihood of moving between them. The chapter’s goals are to build intuition for states and their probabilities, construct and interpret transition matrices, make short- and long-horizon forecasts, reason about long-run equilibrium, and understand absorbing states, all with both manual calculations and programmatic workflows.

The mechanics center on defining mutually exclusive, collectively exhaustive states; capturing the present distribution as a state-probability vector; and using a square transition matrix whose rows sum to one. One-period forecasts come from multiplying the current state vector by the transition matrix; multi-period forecasts iterate this step or use powers of the matrix to “jump” across multiple periods. A detailed wireless-carrier example shows how churn redistributes market share and how successive forecasts typically exhibit diminishing changes as the system stabilizes. The chapter emphasizes assumptions (constant transition probabilities and an unchanged system) and demonstrates efficient, reliable implementation with Python and NumPy for matrix multiplication and repeated projection.

Long-run behavior is analyzed via equilibrium (steady-state) conditions, where repeated transitions converge to a stable distribution, illustrated with a two-state engine example and a discussion of sensitivity to small changes in transition probabilities. The chapter then treats absorbing states—terminal states that, once entered, cannot be left—using a credit-delinquency model with “current” and “charged off” as absorbing outcomes. It partitions the transition matrix and computes the fundamental matrix (the inverse of identity minus the transient block) to derive absorption probabilities, again automating the workflow in Python. These tools enable practitioners to forecast short- and long-run outcomes, quantify risk, and guide strategy in domains like marketing, finance, and operations.

Summary

  • Markov analysis is a statistical method used to predict the future states of a system based on its current state and the probabilities of transitioning from one state to another. It relies on the assumption that the future state depends only on the present state and not on the sequence of events that preceded it.
  • The vector of state probabilities represents the probabilities of a system being in each possible state at a given period. It is used to describe the distribution of states in the system and is essential for predicting future states using Markov analysis.
  • The matrix of transition probabilities is a square matrix where each element represents the probability of transitioning from one state to another in a given period. This matrix is fundamental in Markov analysis for determining the likelihood of moving between states and predicting future state distributions.
  • To predict future states in Markov analysis, the vector of state probabilities and the transition probability matrix are used together through the mathematical operation known as the dot product. The vector of state probabilities represents the current distribution of the system across various states. By taking the dot product of this vector with the transition probability matrix, which contains the probabilities of moving from one state to another, we can calculate the vector of state probabilities for the next period. Repeatedly applying the dot product operation allows us to forecast the system's state distribution over multiple future periods, effectively predicting how the system will evolve over time.
  • In Markov analysis, equilibrium conditions refer to a state where the system's probabilities stabilize and no longer change significantly over time. At equilibrium, the vector of state probabilities remains constant from one period to the next, indicating that the system has reached a steady state where the transitions between states balance out.
  • Absorbing states are states that, once entered, cannot be left. When a system reaches an absorbing state, it remains in that state permanently. These states have a transition probability of 1 for remaining in the same state and 0 for transitioning to any other state.
  • Markov analysis has diverse real-world applications across industries. It is otherwise used in finance for credit risk modeling and stock market analysis, healthcare for patient progression modeling, operations management for equipment maintenance and reliability analysis, and cybersecurity for detecting anomalous network behavior and predicting potential security threats. By applying Markov analysis to these domains, businesses and researchers can make data-driven decisions and optimize long-term outcomes.

FAQ

What is the Markov property, and why does it matter for predicting future states?The Markov property means the next state depends only on the current state, not on the path taken to get there. This memoryless structure lets us summarize a system with a vector of current state probabilities and a transition matrix, making multi-period forecasting tractable for markets, machines, and credit behavior.
What are “states” and a “vector of state probabilities” in Markov analysis?States are mutually exclusive, collectively exhaustive conditions a system can be in (e.g., engine running/not running; customers with one of four carriers). The vector of state probabilities (π) lists the probability of being in each state at a given period and sums to 1.
What is a transition probability matrix and how do I read it?The transition matrix P is square; entry Pij is the probability of moving from state i now to state j next period. Each row represents “from” a current state and must sum to 1. For example, a row like [0.85, 0.06, 0.07, 0.02] means an 85% chance of staying and 15% chance of switching to other states.
How do I predict next period’s distribution of states?Multiply the current state vector by the transition matrix: π(1) = π(0) P. This is a set of dot products between the state vector and each column of P, yielding the forecast probabilities for the next period.
How can I forecast multiple periods ahead (e.g., directly from period 0 to period 2)?Use powers of the transition matrix: π(t) = π(0) P^t. For two periods, square the matrix (P^2) and multiply π(0) by P^2 to get period-2 probabilities without computing period 1 explicitly.
What are equilibrium (steady-state) conditions in a Markov chain?An equilibrium distribution π* satisfies π* = π* P, meaning the distribution no longer changes from period to period. Many systems converge to such a steady state; for example, the two-state engine example converges to about 66.7% running and 33.3% not running under the given transition probabilities.
What are absorbing states, and how do they change the analysis?Absorbing states cannot be left once entered (row has a 1 on the diagonal and 0 elsewhere). They alter long-run behavior because all probability mass eventually accumulates in absorbing states. In the Harmony Finance example, “current” and “charged off” are absorbing.
What is the fundamental matrix, and how is it used for absorbing chains?Partition the transition matrix so non-absorbing-to-non-absorbing transitions form B and non-absorbing-to-absorbing transitions form A. The fundamental matrix F = (I − B)^−1 captures expected visits to transient states. Multiplying F by A (FA) gives probabilities of eventual absorption in each absorbing state (e.g., early delinquency ≈ 98.3% to current, 1.7% to charge-off; late ≈ 85% to current, 15% to charge-off).
How sensitive are steady-state results to small changes in transition probabilities?Very. Small adjustments in row probabilities can lead to large changes in long-run distributions. In the engine example, slightly lowering the “stay” probabilities flips the steady state from mostly running (~66.7%) to mostly not running (~66.7%). Accurate estimation of P is critical.
How do I implement Markov analysis in Python?- Define π(0) and P as NumPy arrays. - Next period: pi_1 = pi_0 @ P. - k steps ahead: pi_k = pi_0 @ np.linalg.matrix_power(P, k). - Iterate π ← π @ P until convergence to estimate equilibrium. - For absorbing chains: partition P into I, A, B; compute F = (I − B)^−1 and FA = F @ A for absorption probabilities.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Statistics Every Programmer Needs ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Statistics Every Programmer Needs ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Statistics Every Programmer Needs ebook for free