Calculator inputs
Formula used
Stationary equation: πP = π
Probability constraint: Σπᵢ = 1
Power iteration: π(k + 1) = π(k)P
Residual check: residual = ||πP − π||₁
Mean recurrence: expected return time for state i = 1 / πᵢ
The linear method replaces one dependent equation with the sum constraint. The power method checks convergence from the selected starting distribution.
How to use this calculator
- Enter a square transition matrix. Each row should describe one current state.
- Add optional state names, separated by commas.
- Enter an initial distribution for forecast and power iteration checks.
- Enable row normalization when using counts or rounded rows.
- Select the method, tolerance, forecast steps, and decimal precision.
- Press the calculate button. Results appear above the form.
- Review the chart, residual, and recurrence values.
- Use CSV or PDF export for reporting.
Example data table
This sample uses three states: Stable, Watch, and Risk.
| From \ To | Stable | Watch | Risk | Row sum |
|---|---|---|---|---|
| Stable | 0.70 | 0.20 | 0.10 | 1.00 |
| Watch | 0.10 | 0.60 | 0.30 | 1.00 |
| Risk | 0.20 | 0.30 | 0.50 | 1.00 |
Why Stationary Distributions Matter
A stationary distribution shows the long run share of time spent in each state. It is useful when a system moves between categories again and again. Common examples include customer status, machine condition, credit ratings, weather states, and website behavior. The result does not describe one trip only. It describes the stable balance created by repeated transitions.
Reading the Transition Matrix
Each row in the matrix represents a current state. Each column represents the next state. The values in a row should add to one. That means the row describes all possible next moves. This calculator can also normalize rows. That option helps when you enter counts, percentages, or rounded values. Still, clean probability inputs give the best interpretation.
How the Calculator Solves It
The main equation is pi P equals pi. Here, P is the transition matrix. Pi is the stationary probability vector. The calculator solves this equation with a linear system and also checks it with power iteration. Power iteration repeatedly multiplies an initial distribution by the matrix. When changes become very small, the chain has reached a stable estimate.
Interpreting the Results
Larger stationary probabilities mean the process spends more time in those states. A small residual suggests the solution is stable. The convergence chart shows how quickly repeated steps approach the steady pattern. Mean recurrence time gives a simple waiting measure. It is the inverse of each stationary probability. Larger values imply less frequent returns.
Good Modeling Practice
Use realistic states and avoid mixing unlike categories. Check that every row has a clear meaning. Review any zero rows before solving. Compare the stationary result with your domain knowledge. A surprising value may reveal a data problem, a rare transition, or a strong absorbing behavior. Use exported files to document assumptions and share results with teammates.
Limits to Remember
Some chains have more than one closed class. Then one unique stationary story may not describe every starting point. Periodic chains can also oscillate before settling in averages. For these cases, compare the linear result, power result, residual, and step forecast. Together, these checks give a view of the model and assumptions over time.
FAQs
What is a stationary distribution?
It is a probability vector that stays unchanged after one transition. If πP equals π, the vector is stationary. It describes long run state proportions for many Markov chains.
Do all Markov chains have one unique result?
Finite chains have at least one stationary distribution. A unique limiting distribution usually needs suitable connectivity and no problematic periodic behavior. Reducible chains may have multiple stationary distributions.
Should matrix rows or columns add to one?
This calculator uses row-stochastic matrices. Each row represents the current state, and row values show next-state probabilities. Therefore, every row should sum to one.
What does row normalization do?
Row normalization divides every value in a row by that row's total. It is useful for count data, percentages, or rounded input. Do not use it to hide data errors.
What is the residual value?
The residual measures how close the output is to satisfying πP equals π. A smaller residual means a more stable solution. Large residuals need closer review.
Why use power iteration?
Power iteration shows how repeated transitions behave from a chosen start. It is helpful for convergence checks, step forecasts, and practical validation of the linear answer.
What is mean recurrence time?
Mean recurrence time estimates the expected return interval for a state. In a positive recurrent chain, it equals one divided by that state's stationary probability.
When should I use teleportation smoothing?
Use it when the chain is reducible, nearly disconnected, or difficult to compare. A small factor spreads probability across states and can improve numerical behavior.