Stationary distribution calculator
Solve πP = π and check the normalised probabilities against the transition matrix. Your inputs stay on your device.
Set up your task
Starting local processing
Ready. Processing stays in this browser.
2 Your result
Your result updates in this browser. Check your input if the result looks unexpected.
How to use Stationary distribution calculator
Solve πP = π and check the normalised probabilities against the transition matrix. The pre-filled problem gives you a worked starting point. Compare the response with your own working before trying the self-check below.
- Check the example inputs: Transition matrix (one row per line).
- Change the inputs for your problem. Results update as you type, so finish entering the values before copying an answer.
- Use the working to check an intermediate value or assumption. Then change the example as suggested in the self-check and compare the result.
Supported inputs and limits
Use up to eight states with a row-stochastic matrix. The tool reports when it cannot reliably identify a unique stationary distribution.
How it works
A stationary distribution is unchanged by applying the transition matrix once. It satisfies πP = π along with the requirement that its probabilities add to one. This is a condition on the distribution at a step, even when a particular starting state leads to periodic behaviour.
The tool solves the linear equations with one row replaced by the normalisation equation. It uses pivoting and reports a numerical residual after the probability vector has been checked. Separate closed classes can produce infinitely many stationary mixtures, so the calculator flags cases where it cannot resolve a unique solution.
Example
Run the pre-filled example. Its first result is “Stationary distribution: 0.666666667 0.333333333”.
- Transition matrix (one row per line)
- 0.8 0.2
0.4 0.6
Stationary distribution: 0.666666667 0.333333333 Residual |πP − π|₁: 5.55111512e-17 A stationary distribution stays unchanged when the transition is applied.
Questions about Stationary distribution calculator
What happens for an identity transition matrix with multiple states?
Every starting probability vector is unchanged. The system has many stationary distributions and there is no unique answer to report.
Does stationary always mean that every initial vector converges to it?
A periodic chain can have a stationary distribution while some initial distributions keep oscillating. Existence and convergence are distinct properties.
Enter the two-state transition rows 0 1 and 1 0.
The stationary vector is one half in each state. Starting entirely in one state instead would alternate between states.
Related tools
Last updated