Stationary Matrix Markov Chain Calculator

Analyze steady-state behavior for custom stochastic matrices efficiently. Review row checks, powers, charts, and exports. Turn transition data into useful long-run probability insights today.

Calculator inputs

Use the options below to build a valid stochastic transition matrix.

Transition matrix

Each row represents current-state probabilities flowing into the next step.

From \ To State 1 State 2 State 3
State 1
State 2
State 3

Initial distribution vector

These values describe the starting probability across states at step zero.

Example data table

This sample shows a three-state transition matrix and the resulting long-run proportions.

State To State 1 To State 2 To State 3 Sample stationary probability
State 1 0.70 0.20 0.10 0.4565
State 2 0.30 0.40 0.30 0.2826
State 3 0.20 0.30 0.50 0.2609

Formula used

The stationary distribution is the probability row vector that remains unchanged after one transition.

πP = π

The vector must also satisfy the probability constraint.

Σπᵢ = 1

The projected distribution after each step follows the Markov update rule.

xₜ₊₁ = xₜP

The calculator solves the steady-state equations, then compares projected distributions against that long-run solution. It also reports row sums, iteration changes, and the L1 distance from the current vector to the stationary vector whenever the stationary solution is uniquely identified.

How to use this calculator

  1. Select the number of states for the chain.
  2. Enter a valid transition matrix with each row summing to one.
  3. Enter the initial distribution vector for step zero.
  4. Choose projection steps, tolerance, and displayed decimals.
  5. Click Calculate to show results above the form.
  6. Review the stationary distribution, projected distribution, and trajectory table.
  7. Inspect the Plotly chart to see probability movement by step.
  8. Use the CSV and PDF buttons to export your results.

FAQs

1. What does the stationary distribution represent?

It shows the long-run probability share spent in each state, provided the chain supports a stable limiting pattern. It answers where the process settles over many transitions.

2. Why must every row sum to one?

Each row lists all possible next-state probabilities from one current state. Since one of those outcomes must happen, the probabilities in that row must total exactly one.

3. Why do I need an initial distribution?

The initial distribution controls the starting mix across states. It affects short-run projections and convergence paths, even when the stationary distribution itself is unique.

4. What if the calculator cannot identify a unique stationary distribution?

That usually means the chain may have multiple stationary solutions, disconnected classes, or structural restrictions. The projected path can still be shown, but one universal long-run vector may not exist.

5. What does the L1 distance mean?

The L1 distance measures the total absolute gap between two probability vectors. Smaller values mean the projected distribution sits closer to the stationary distribution.

6. Can I use more than six states?

This page keeps the interface compact by supporting two through six states. You can extend the file later by raising the state limit and keeping the same solving logic.

7. Why might convergence appear slow?

Slow convergence often happens when states transition very similarly, when probabilities are highly persistent, or when the chain is near periodic. Increasing the step count usually reveals the trend better.

8. Do exports include the calculated tables?

Yes. The CSV export includes stationary values and trajectory rows. The PDF export adds summary metrics and both result tables in a clean downloadable report.

Related Calculators

p value between two means 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.