50 / Decision analytics
Markov chains for customer and operating states
A Markov chain tracks movement among defined states using a transition matrix. It gives a structured scenario for retention, risk status or equipment condition while exposing its memory and transition-stability assumptions.
The business question
How might the numbers of customers or assets in different states evolve under stated transition probabilities?
- Project a fixed customer cohort across active, at-risk and lost states.
- Explore a policy scenario that changes a specific transition while recognising that the assumed transition change needs evidence.
How the method works
Choose mutually exclusive, collectively exhaustive states and a time interval. Each row of the transition matrix gives probabilities of moving from its current state to every possible next state and must sum to one. The Markov assumption says that, after conditioning on the current state, earlier history adds no predictive information for the next transition.
Multiply the current row vector of state counts by the matrix to obtain next-period expected counts. Repeated multiplication gives multi-period scenarios when the matrix is held constant. Fractional counts are expectations across possible cohorts, not literal fractional customers. New acquisitions need to be added explicitly rather than silently appearing in a fixed-cohort model.
An absorbing state cannot be left once entered. Making lost customers permanently lost changes long-run behaviour compared with a model allowing reactivation. Not every matrix has one meaningful, unique convergent steady state. Estimate transitions on suitable longitudinal data and validate them on later periods. Duration in state, seasonality or changed policies can invalidate a simple memoryless homogeneous chain.
The calculation
| Symbol | Meaning |
|---|---|
| P_ij | Conditional probability of moving from current state i to next-period state j. |
| State-count vector | Expected numbers in each state, written as a row vector in this example. |
| Absorbing state | A state with probability one of remaining in itself once reached. |
A worked business example
ILLUSTRATIVE SCENARIO
Illustrative customer cohort with active, at-risk and lost states and no new acquisitions during a two-month scenario.
Inputs
- Initial counts: 800 active, 150 at risk and 50 lost.
- Active transition row: 0.80, 0.15, 0.05. At-risk row: 0.30, 0.50, 0.20. Lost row: 0, 0, 1.
- Illustrative monthly contributions: R100 per active customer, R40 per at-risk customer and zero per lost customer.
Work through the numbers
- Month-1 active = 800 × 0.80 + 150 × 0.30 = 685.
- Month-1 at risk = 800 × 0.15 + 150 × 0.50 = 195; lost = 40+30+50 = 120.
- Month-2 active = 685 × 0.80 + 195 × 0.30 = 606.5.
- Month-2 at risk = 685 × 0.15 + 195 × 0.50 = 200.25; lost = 193.25.
- Month-1 contribution = 685 × R100 + 195 × R40 = R76,300; month-2 contribution = R68,660.
The path is conditional on the supplied matrix and absorbing lost state. It does not show that a company will follow this path or that an intervention can achieve different transitions.
Explore the decision
Explore active and inactive customer states. The live explorer has its own example inputs; it is separate from the worked calculation above.
Enable JavaScript to use this calculator. The worked example and executable Python remain available.
Apply it at work
- Define states, event timing and the observation interval using reliable customer or asset records.
- Estimate transition rows from relevant longitudinal data and examine sparse states, duration and history effects.
- Check row sums, compare multi-period scenarios and validate predictions on a later period.
- Test proposed transition changes with a credible intervention study, including costs and possible side effects.
Check these assumptions
- Current state captures the history relevant to the next transition for this approximation.
- Transition probabilities remain sufficiently stable over the horizon or are explicitly time-varying.
- All material states and acquisition, reactivation or exit mechanisms are represented.
- Customers or assets have comparable transitions within states, or heterogeneity is modelled separately.
Common mistakes and how to avoid them
- A cohort projection is not a full customer-base forecast when acquisition and reactivation are omitted.
- Long-run interpretations require matrix-specific conditions; convergence cannot be assumed for every chain.
- Descriptive transition probabilities do not identify the causal effect of a management intervention.
How this can help the business
- The model exposes which deterioration or recovery transition drives the scenario and deserves better measurement.
- State definitions can improve tracking and connect customer counts to contribution, workload or service demand.
Use a transition scenario when states and probabilities validate adequately for the horizon; base intervention decisions on evidence about achievable transition changes and their cost.
When to use another approach
Use survival or duration models when time in state matters, hidden-state models for imperfect observation, or simulation for more complex histories.
Reproduce the worked example in Python
The code is self-contained for this example. Dependencies and run instructions are included with the downloadable notebook.
Show executable code and recorded output
import numpy as np
transition = np.array([[0.8,0.15,0.05],[0.3,0.5,0.2],[0,0,1]])
counts = np.array([800.0,150.0,50.0])
margin = np.array([100,40,0])
assert np.allclose(transition.sum(axis=1),1)
for month in [1,2]:
counts = counts @ transition
print("Month",month,"active/at-risk/lost:",np.round(counts,3).tolist())
print("Expected contribution: R",round(counts @ margin,2))
print("Lost is absorbing; this model includes no new customers.")Recorded output
Month 1 active/at-risk/lost: [685.0, 195.0, 120.0] Expected contribution: R 76300.0 Month 2 active/at-risk/lost: [606.5, 200.25, 193.25] Expected contribution: R 68660.0 Lost is absorbing; this model includes no new customers.
Sources and further reading
Concepts are linked to primary teaching or technical sources. The business examples are illustrative applications, not reported client results.