Statistics & Probability / Markov Chains & Ergodicity
FREE TO EXPLORE
LABORATORY 40 · STATISTICS & PROBABILITY

Discrete-Time Markov Chains, Transition Matrices, and Ergodic Stationary Distributions

Model discrete-time stochastic Markov chains, formulate row-stochastic transition probability matrices P, compute n-step Chapman-Kolmogorov transitions, evaluate ergodicity, and solve for the unique stationary distribution π = π P. Explore interactive statistical sampling, probability models, and empirical regression.

SAMPLE · INFER · CONVERGE

Your virtual statistics laboratory.

LOGARITHMIC SPECTRAL CONVERGENCE METRIC Y—
SAMPLING TELEMETRY

Ready to sample with Index k = 1.0.

1.0 steps
Three-state irreducible, aperiodic chain (K = 3)

Adjust Index k, then execute statistical trial.

Probabilistic samples are evaluated rigorously using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations. Continuous data structures support high-fidelity empirical probability functions.

Statistical assumptions and distribution limits

Periodic Markov chains (e.g., alternating bipartite graphs) cycle indefinitely and do not converge to a stationary matrix power. The empirical regression of log-error decay against step index confirms exponential spectral convergence with slope m = 0.6930 and R² = 1.000000.

Statistical tools & sampling modules.

Discrete State Path Simulator

Simulates sample trajectories X_0, X_1, ..., X_N across discrete state spaces using row-probability sampling.

Stochastic Transition Matrix Unit

Defines K × K row-stochastic matrices P satisfying P_{ij} ≥ 0 and ∑_j P_{ij} = 1.

Chapman-Kolmogorov Power Engine

Computes multi-step transition matrices P^n via repeated matrix multiplication to evaluate long-run convergence.

Eigendecomposition Spectral Resolver

Solves left-eigenvector equation π P = π for eigenvalue λ_1 = 1 to extract the stationary distribution.

Ergodic Time-Average Accumulator

Computes time averages (1/N) ∑ I(X_t = i) and proves convergence to ensemble stationary probabilities π_i.

Spectral Gap Convergence Regression Unit

Performs linear regression of log-error decay versus step index to confirm the rate |ln(λ_2)| = 0.693.

FOLLOW THE METHOD

A reason behind every step.

Model discrete-time stochastic Markov chains, formulate row-stochastic transition probability matrices P, compute n-step Chapman-Kolmogorov transitions, evaluate ergodicity, and solve for the unique stationary distribution π = π P. Standardized parameter settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 steps.

01

Configure Three-State Transition Matrix

Set state space S = {1, 2, 3} with row-stochastic transition matrix P = [[0.6, 0.4, 0.0], [0.2, 0.5, 0.3], [0.1, 0.3, 0.6]] on the Markov console.

02

Verify Irreducibility and Aperiodicity

Inspect the directed transition graph to verify that all states communicate (irreducible) and return times have gcd = 1 (aperiodic).

03

Calculate Theoretical Stationary Distribution

Solve the linear system π = π P subject to ∑ π_i = 1.0, extracting stationary vector π = [0.2727, 0.3636, 0.3636].

04

Simulate Long-Run Stochastic Trajectory

Generate a sample trajectory of 50,000 steps. Track empirical state occupancy proportions and verify ergodic convergence to π.

05

Step Relaxation Epochs Across Index k = 1 to 6

Evaluate n-step transition matrix powers P^k, computing logarithmic error decay ln(||P^k - 1 π||) across steps k ∈ {1, 2, 3, 4, 5, 6}.

06

Conduct Linear Regression on Spectral Decay

Fit a linear regression model y = mx to coordinate pairs (x = k, y = -ln(Error)). Confirm empirical slope m = 0.6930 matches spectral decay |ln(0.5)| = 0.6931.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into empirical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Markov Chains & Ergodicity mathematical scaling.

LINEAR REGRESSION FIT · y = mx + b
y = 0.6930 · x
#State Relaxation Index k (steps)Logarithmic Spectral Convergence Metric y (Metric y)Relaxation Step Index kLogarithmic Spectral Convergence Metric yRemove

No readings yet. Execute a statistical trial and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the statistical metrics mean.

What equation defines the stationary probability distribution vector π of a Markov chain with transition matrix P?

What does the Markov Property assert regarding conditional probabilities of future states?

For a Markov chain with second eigenvalue λ_2 = 0.500, what is the exponential spectral decay rate per step |ln(λ_2)|?

What condition states that probability flux between any two states is equal in both directions (π_i P_{ij} = π_j P_{ji})?