Stationary Distribution Solver Calculator

Solve steady distributions from transition matrices using flexible controls. Review errors, iterations, and residual quality. Model long term probabilities clearly for every named state.

Calculator Input

Enter a row-stochastic transition matrix. Each row must sum to 1. You may separate values with spaces, commas, or semicolons.

Choose between 2 and 12 states.
Comparison mode reports both methods side by side.
Controls the precision shown in output tables.
Used only by power iteration.
Higher limits help slow-mixing chains.
Comma separated, for example: A, B, C.
Optional. Blank input defaults to a uniform distribution.
Each line is a row. Example row: 0.70 0.20 0.10

Example Data Table

State Transition Row Example Stationary Probability
State A 0.70, 0.20, 0.10 0.478723
State B 0.30, 0.40, 0.30 0.265957
State C 0.25, 0.25, 0.50 0.255319

This sample chain is irreducible and includes self-loops, so it is a practical example for long-run probability analysis.

Formula Used

Stationary distribution condition:

πP = π

Normalization constraint:

Σ πᵢ = 1

Power iteration update:

xk+1 = xkP

Residual check:

Residual = ‖πP − π‖₁

The calculator solves the steady-state vector for a finite Markov chain. Linear solve handles the balance equations directly. Power iteration repeatedly propagates an initial distribution through the transition matrix until the change falls below the chosen tolerance.

How to Use This Calculator

  1. Set the number of states.
  2. Enter state names in the same order as your matrix rows.
  3. Paste the transition matrix, one row per line.
  4. Ensure every row sums exactly to 1.
  5. Choose linear solve, power iteration, or comparison mode.
  6. Enter an initial distribution for convergence testing, or leave the default.
  7. Set tolerance, iteration cap, and display precision.
  8. Press submit to view the stationary probabilities, diagnostics, and Plotly graph.
  9. Use the CSV and PDF buttons to export your result.

Frequently Asked Questions

1) What does a stationary distribution represent?

It represents long-run state probabilities for a Markov chain. If the chain mixes well, repeated transitions drive many starting distributions toward this stable probability vector.

2) Why must each transition row sum to 1?

Each row lists all possible next-state probabilities from one current state. Since one of those outcomes must occur, the full row must total exactly 1.

3) When should I use power iteration?

Use power iteration when you want to inspect convergence behavior, test sensitivity to an initial distribution, or work with larger matrices where iterative methods are convenient.

4) When is linear solve better?

Linear solve is often faster for small and medium matrices. It directly solves the stationary equations and usually provides a clean reference solution for comparison.

5) Can a chain have more than one stationary distribution?

Yes. Reducible chains can admit multiple stationary distributions. In those cases, convergence and uniqueness depend on the chain’s communicating classes and the initial distribution.

6) What does the residual tell me?

The residual measures how closely the reported vector satisfies πP = π. Smaller residuals indicate a more accurate stationary solution.

7) Why can power iteration fail to converge quickly?

Slow mixing, near-reducibility, periodic behavior, or a very strict tolerance can require many iterations. Increasing the iteration cap often helps reveal the trend.

8) Does the calculator test ergodicity?

It provides helpful diagnostics, including a strong connectivity test and a self-loop based aperiodicity check. Those are practical indicators, not a full symbolic proof.

Related Calculators

state transition diagram toolforward algorithm calculatorviterbi path calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.