Markov Chain Solver
Steady-state probabilities and multi-step forecasts for discrete-time Markov chains — weather, brand switching, machine states, and queue regimes.
Transition matrix P
| From \\ To | Row Σ | ||||
|---|---|---|---|---|---|
| Sunny | 1.00 | ||||
| Cloudy | 1.00 | ||||
| Rainy | 1.00 |
Markov property
A discrete-time Markov chain’s next state depends only on the current state (memoryless). Transitions are stored in a row-stochastic matrix P where each row sums to 1.
Steady state
If the chain is irreducible and aperiodic on a finite state space, it converges to a unique π:
πᵢ is the long-run fraction of time spent in state i.
n-step projection
Useful for short-horizon forecasts (weather tomorrow, brand share next quarter) before steady state.
Modeling tips
Define mutually exclusive states, estimate rows from historical frequencies, and check that rows sum to 1 (use Normalize). Absorbing states need care — steady state may pile on absorbers.
3-state weather chain. Start in Sunny and project 3 days ahead; also compute long-run climate shares.