Markov Chain Stationary Distribution Calculator
Calculate the stationary distribution of a 2-state or 3-state Markov chain given its transition probability matrix.
Formulas Used
The stationary distribution \\( \pi \\) of a Markov chain satisfies \\( \pi P = \pi \\), where \\( P \\) is the transition matrix, and the sum of probabilities in \\( \pi \\) equals 1.
- Stationary Distribution Equation:
\\[ \pi P = \pi \\]
Where:
- \\( \pi = [\pi_1, \pi_2, \dots, \pi_n] \\): Stationary distribution
- \\( P \\): Transition probability matrix
- Normalization Condition:
\\[ \pi_1 + \pi_2 + \dots + \pi_n = 1 \\]
- Solving for 2×2 Matrix:
For \\( P = \begin{bmatrix} p_{11} & p_{12} \\ p_{21} & p_{22} \end{bmatrix} \\), solve:
\\[ \pi_1 p_{11} + \pi_2 p_{21} = \pi_1 \\]
\\[ \pi_1 p_{12} + \pi_2 p_{22} = \pi_2 \\]
\\[ \pi_1 + \pi_2 = 1 \\]
Result: \\( \pi_1 = \frac{p_{21}}{p_{12} + p_{21}}, \pi_2 = \frac{p_{12}}{p_{12} + p_{21}} \\)
- Solving for 3×3 Matrix:
For a 3×3 matrix, solve the system \\( \pi (P – I) = 0 \\) with \\( \pi_1 + \pi_2 + \pi_3 = 1 \\).
Example Calculations
Example 1: 2×2 Matrix
Input: Transition Matrix = \\( \begin{bmatrix} 0.7 & 0.3 \\ 0.4 & 0.6 \end{bmatrix} \\)
Calculations:
- Stationary distribution: \\[ \pi_1 = \frac{0.4}{0.3 + 0.4} = \frac{0.4}{0.7} \approx 0.5714 \\]
- \\[ \pi_2 = \frac{0.3}{0.3 + 0.4} = \frac{0.3}{0.7} \approx 0.4286 \\]
- Verification: \\[ 0.5714 + 0.4286 = 1 \\]
Result: Stationary Distribution = [0.5714, 0.4286]
Example 2: 3×3 Matrix
Input: Transition Matrix = \\( \begin{bmatrix} 0.5 & 0.3 & 0.2 \\ 0.3 & 0.4 & 0.3 \\ 0.2 & 0.3 & 0.5 \end{bmatrix} \\)
Calculations:
- Solve: \\( \pi_1 = \pi_2 = \pi_3 = \frac{1}{3} \approx 0.3333 \\)
- Verification: \\[ 0.3333 + 0.3333 + 0.3333 = 1 \\]
Result: Stationary Distribution = [0.3333, 0.3333, 0.3333]
How to Use the Calculator
Follow these steps to calculate the stationary distribution of a Markov chain:
- Select Matrix Size: Choose 2×2 or 3×3 for the number of states.
- Enter Transition Probabilities: Input probabilities (0 to 1) for each matrix element. Each row must sum to 1.
- Calculate: Click “Calculate Stationary Distribution” to see the result.
- Interpret Result: The result shows the stationary distribution with calculations.
- Share or Embed: Use the share buttons to post results on social media, copy the result, or get an embed code.
Note: Probabilities must be between 0 and 1, and each row must sum to 1 (within 0.01 tolerance). The chain is assumed to be irreducible and aperiodic. Invalid inputs will prompt an error.