Module contents
Lesson 15 of 31Advanced 100 min

General state space Markov chains and stability of autoregressive models

AR(1), GARCH and MCMC samplers are Markov chains with continuous state spaces. Extend the theory using transition kernels, φ-irreducibility and Harris recurrence, then introduce Foster-Lyapunov drift conditions as a practical tool for proving geometric ergodicity. Apply them to nonlinear autoregressions such as threshold SETAR and connect mixing coefficients with the CLT and time-series bootstrap.

After this lesson you can

  • Write AR, SETAR and GARCH time-series models as Markov chains with explicit transition kernels.
  • Verify drift conditions to establish geometric ergodicity for AR(1) and SETAR.
  • Identify SETAR parameter regions stable even when one regime is explosive.
  • Relate geometric ergodicity to the Markov-chain CLT and MCMC validity.
  • Explain mixing conditions needed for block bootstrap and what happens when they fail.

Before you start

A chain can live on a continuum

An AR(1) with Gaussian noise can take any real value; a Monte Carlo chain can traverse a parameter space with hundreds of dimensions. Drawing a finite matrix and raising it to a power is no longer enough. We want to know whether a stable distribution exists, whether the chain forgets its start, and when it is legitimate to quantify error in an average.

A Lyapunov function measures how far the state is from a controlled region. In the figure, drift is calculated for the indicated model. A candidate function can fail even when the system is stable: a sufficient proof is not a necessary condition for every function choice.

InteractiveDrift in the plane

The chain is Xₜ₊₁=AXₜ+εₜ₊₁ with A=[[a,b],[0,c]] and iid εₜ ~ N(0,I₂). Candidate V(x)=1+x₁²+qx₂² with q>0. At each point, color comes from exact PV(x)−V(x)=xᵀDx+1+q, where D=AᵀQA−Q and Q=diag(1,q); there is no Monte Carlo simulation.

x₁ horizontal; x₂ vertical. Drag the point or use keyboard arrows.
  • Negative drift
  • Nonnegative drift
  • Selected state

D is not certified negative definite: this V does not establish strictly negative drift in all exterior directions. That does not establish instability: a stable matrix may require another weighting or quadratic form with cross terms.

The spectral radius of this triangular A is max(|a|,|c|), independent of b. Negativity on a finite grid does not prove a global condition: full matrix calculation is used here. In the certified case, C is compact and small because the Gaussian kernel has continuous strictly positive density; with irreducibility and aperiodicity, the drift condition establishes geometric ergodicity. Positive-drift points near the origin do not contradict the exterior condition.

Quadratic candidate
1.00
0.65
0.90
0.70
Spectral radius of A0.700
Linear chainStable
Maximum eigenvalue of D0.593
This V certifies exterior driftNo
PV−V at point5.023
Compare expected changes in different quadratic functions. Negativity on a finite grid is visual evidence, not a proof by itself.

Kernels and sufficient states

A transition kernel P(x,A)P(x,A) is a probability on AA for each state xx and is measurable in xx for each measurable set AA. It acts on functions and measures through

Pf(x)=∫f(y)P(x,dy),(μP)(A)=∫P(x,A)μ(dx).Pf(x)=\int f(y)P(x,dy),\qquad (\mu P)(A)=\int P(x,A)\mu(dx).

Invariance is πP=π\pi P=\pi. In Xt+1=ϕXt+εt+1X_{t+1}=\phi X_t+\varepsilon_{t+1} with innovation density gg, P(x,A)=∫Ag(y−ϕx) dyP(x,A)=\int_A g(y-\phi x)\,dy. For a two-regime SETAR, replace ϕx\phi x with transition function m(x)m(x) depending on sign or threshold. The Markov property requires the state to include all information needed for the next transition.

In a GARCH(1,1), with ω>0\omega>0, α,β≥0\alpha,\beta\ge0, ht+1=ω+αrt2+βhth_{t+1}=\omega+\alpha r_t^2+\beta h_t and rt+1=ht+1Zt+1r_{t+1}=\sqrt{h_{t+1}}Z_{t+1}, the pair (rt,ht)(r_t,h_t) is a Markov state if innovations ZtZ_t are iid and independent of the past. For ht+1h_{t+1} to be conditional variance, also take EZt=0\mathbb E Z_t=0 and EZt2=1\mathbb E Z_t^2=1. If ZZ has law FZF_Z and H(r,h)=ω+αr2+βhH(r,h)=\omega+\alpha r^2+\beta h, its kernel is

P((r,h),A)=∫1A(H(r,h)z,H(r,h)) FZ(dz).P((r,h),A)=\int \mathbf1_A\bigl(\sqrt{H(r,h)}z,H(r,h)\bigr)\,F_Z(dz).

The ht+1h_{t+1} component is deterministic and the return component random; do not simply assume the kernel has a strictly positive density across the whole plane. The return alone generally does not contain all information about conditional variance.

Irreducibility, recurrence and regeneration

A chain is φ\varphi-irreducible if from any state it can reach every measurable set of positive φ\varphi measure with positive probability in some number of steps that may depend on state and set. Measure φ\varphi need not be a probability distribution. For an irreducible chain, Harris recurrence requires visiting every set of positive irreducibility measure infinitely often almost surely from every state. Positive recurrence adds a normalizable invariant measure; recurrence does not mean fast return.

A set CC is small if there exist m≥1m\ge1, ϵ>0\epsilon>0 and a probability ν\nu such that

Pm(x,A)≥ϵν(A)para todo x∈C y todo A.P^m(x,A)\ge\epsilon\nu(A)\quad\text{para todo }x\in C \text{ y todo }A.

That minorization decomposes the transition into a common and residual part. On visiting CC, an auxiliary construction can regenerate from ν\nu with probability ϵ\epsilon; segments between regenerations facilitate laws of large numbers and central limits. Minorization must be proved uniformly on the set, not only at grid points.

For AR(1) with positive-variance normal innovation, every compact CC is small: density p(x,y)p(x,y) is continuous and positive, so it has a positive minimum on C×[−1,1]C\times[-1,1]. Taking ν\nu uniform on that interval gives one-step minorization. The same positivity gives Lebesgue irreducibility and aperiodicity.

Drift and geometric ergodicity

A Foster-Lyapunov condition seeks V≥1V\ge1, 0<λ<10<\lambda<1, b<∞b<\infty and a small set CC such that

PV(x)≤λV(x)+b 1C(x).PV(x)\le\lambda V(x)+b\,\mathbf 1_C(x).

Outside CC, the expected value of VV contracts; inside it may increase but remains controlled. With irreducibility, aperiodicity, an invariant distribution and corresponding finiteness assumptions, drift and minorization imply geometric ergodicity:

∥Pn(x,⋅)−π∥TV≤M(x)ρn,0<ρ<1,\|P^n(x,\cdot)-\pi\|_{\rm TV}\le M(x)\rho^n,\qquad 0<\rho<1,

for states covered by the theorem. Factor M(x)M(x) may grow with the initial state; it is not a uniform bound across the space. An inequality for a function VV without minorization and irreducibility is insufficient. Roberts and Rosenthal present the theorem and its conditions.

For an AR(1) with ∣ϕ∣<1|\phi|<1, state-independent centered innovations of variance σ2\sigma^2, and V(x)=1+x2V(x)=1+x^2,

PV(x)=1+σ2+ϕ2x2.PV(x)=1+\sigma^2+\phi^2x^2.

Choose any λ∈(ϕ2,1)\lambda\in(\phi^2,1) and RR with R2≥(1+σ2−λ)/(λ−ϕ2)R^2\ge(1+\sigma^2-\lambda)/(\lambda-\phi^2). For C=[−R,R]C=[-R,R], outside CC we have PV≤λVPV\le\lambda V, and inside b=1+σ2−λb=1+\sigma^2-\lambda suffices. With Gaussian innovations, compact sets are small and the stationary distribution from the causal series exists. The geometric result follows from the preceding theorem.

With Cauchy innovations, PV(x)=∞PV(x)=\infty for that quadratic VV. Do not conclude instability: for 0<s<10<s<1, Vs(x)=1+∣x∣sV_s(x)=1+|x|^s has finite expectation and ∣u+v∣s≤∣u∣s+∣v∣s|u+v|^s\le|u|^s+|v|^s gives drift coefficient ∣ϕ∣s<1|\phi|^s<1. A chain may converge geometrically while its distribution has no mean: the coordinate average does not automatically satisfy a CLT.

One explosive regime does not decide the outcome

A SETAR changes its rule according to its own state. Study the specific case

Xt+1={aXt+εt+1,Xt≥0,bXt+εt+1,Xt<0,εt∼iidN(0,1).X_{t+1}=\begin{cases} aX_t+\varepsilon_{t+1},&X_t\ge0,\\ bX_t+\varepsilon_{t+1},&X_t<0, \end{cases}\qquad \varepsilon_t\overset{\rm iid}{\sim}N(0,1).

For this two-regime, zero-threshold family, the strict stability region is a<1a<1, b<1b<1 and ab<1ab<1. This result is specific to the model and its assumptions, not a rule for every higher-order SETAR. Petruccelli and Woolford study this region and its boundaries.

For example, with a=−1.4a=-1.4 and b=−0.4b=-0.4, the positive regime has modulus greater than one, but a large positive state jumps negative and over the next step is multiplied overall by ab=0.56ab=0.56 without noise. A symmetric quadratic VV does not prove one-step drift on the positive side. Instead use V(x)=1+x2V(x)=1+x^2 if x≥0x\ge0 and V(x)=1+0.4x2V(x)=1+0.4x^2 if x<0x<0. At large absolute values, dominant ratios PV(x)/V(x)PV(x)/V(x) tend to 0.4(1.4)2=0.7840.4(1.4)^2=0.784 on the positive side and 0.42/0.4=0.40.4^2/0.4=0.4 on the negative side. Normal shocks and exceptional crossings do not change these limits: a compact set exists outside which both are below a constant λ<1\lambda<1. Positive density allows minorization on compact sets.

InteractiveStability and regime switching

Parameter plane: horizontal a and vertical b.

  • Ergodic interior
  • Inequality boundaries
  • Selected pair

Three paths from different initial values; horizontal axis: time step.

  • X₀ = -8
  • X₀ = 0
  • X₀ = 8

Xₜ = aXₜ₋₁ + εₜ when Xₜ₋₁ ≥ 0; for Xₜ₋₁ < 0 use bXₜ₋₁ + εₜ. Innovations are independent standard normal. Each path starts at the indicated value and uses its own reproducible pseudorandom stream. It stops at |Xₜ| ≥ 10,000 and includes the value crossing the limit.

For this model, the interior ergodic region simultaneously satisfies a < 1, b < 1 and ab < 1. Boundaries are shown unclassified: the colored region represents strict inequalities. Source: Petruccelli and Woolford (1984), theorem 2.1.

With negative a of modulus greater than one, the positive regime can amplify a step and change sign; a suitable negative b can return the path with product ab < 1. Noise can alter regime changes. A finite path, including one stopped by the limit, does not establish stability or permanent escape.

−1.40
−0.50
160
1
Theoretical classificationErgodic
Product ab0.700
Paths stopped by limit0 / 3
Magnitude limit10.000
Select coefficients and compare this family's theoretical region with simulated paths. A finite path does not prove stability or determine a boundary case.

Metropolis and what a rate means

In random-walk Metropolis propose Y=X+ZY=X+Z with symmetric density and accept with probability min⁡{1,π(Y)/π(X)}\min\{1,\pi(Y)/\pi(X)\}. The chain preserves π\pi under usual assumptions. With a Gaussian target and fixed normal proposal it is geometrically ergodic; with a Cauchy target and normal random-walk proposal it is not. The Cauchy tail lacks exponential moments, a necessary condition for geometric ergodicity in this proposal class under the result’s assumptions. Do not extend this claim to all Metropolis proposals. See the Roberts-Rosenthal review.

In particular, for one-dimensional random-walk Metropolis with fixed nondegenerate normal proposal and target with positive continuous density, geometric ergodicity requires an s>0s>0 with ∫es∣x∣π(x) dx<∞\int e^{s|x|}\pi(x)\,dx<\infty. By contraposition, a target lacking any exponential moment cannot yield geometric ergodicity with that algorithm. The exercise constructs a bottleneck for Cauchy; the general result needs its proof and full conditions, discussed by Fort and Moulines.

InteractiveTwo targets, two dynamics

Estimated binned distance over time; both axes use logarithmic scale

Steps t, log₂(1 + t) axis; distance on log₁₀ scale
  • Normal target
  • Cauchy target
  • MC error bound

Normal: masas observadas y objetivo

Cauchy: masas observadas y objetivo

  • Target mass
  • Simulated normal mass
  • Simulated Cauchy mass

Each target has 4000 chains simulated from the same x₀. Propose Y = X + σZ with standard normal Z and accept with min(1, π(Y)/π(X)); the proposal is symmetric. Bars compare empirical frequencies with masses calculated from distribution functions. The 12 regions are cut at −8, −4, −2, −1, −0.5, 0, 0.5, 1, 2, 4 and 8; regions 1 and 12 include complete tails.

Plotted distance is ½Σ|p̂ᵢ − πᵢ| on that partition. It is not exact continuous TV: the discrete empirical measure has TV 1 relative to a continuous distribution. Partition TV for the true law is a lower bound on full TV; its estimate has noise and positive bias. Values below 0.001 are shown as 0.001 on the log scale.

The displayed bound uses 4000 independent replicates, 12 regions, McDiarmid’s inequality and a union over both targets and 11 times: with probability at least 95%, each true binned distance is within that amount of its estimate. It is conservative and not a bound on full distance to stationarity. The dashed line indicates its magnitude, not a convergence threshold.

A finite curve does not establish an asymptotic rate. For symmetric random-walk Metropolis, a Cauchy target has no exponential moments and the chain is not geometrically ergodic; see Roberts and Rosenthal, section 3.4. Rate and average error also depend on the function studied, start, and proposal scale.

6
1.5
32
Time t32
Estimated binned TV: normal0.0199
Estimated binned TV: Cauchy0.1170
95% simultaneous MC bound±0.054
Cumulative acceptance normal · Cauchy58.4 % · 75.6 %
Chains and seed4000 per target · 2615
Compare Metropolis simulations and estimated distances after binning. Binning and Monte Carlo noise limit interpretation; a finite plot does not prove an asymptotic rate.

An empirical measure made of finitely many points and a continuous distribution are mutually singular: their exact total variation distance is one almost surely. A histogram instead estimates distance between binned distributions, losing information. An apparent slope on a finite plot does not prove geometric or polynomial convergence.

Mixing, CLT and blocks

Mixing coefficients quantify dependence between past and future separated by kk steps. For example,

α(k)=sup⁡A∈F−∞0, B∈Fk∞∣P(A∩B)−P(A)P(B)∣.\alpha(k)=\sup_{A\in\mathcal F_{-\infty}^0,\ B\in\mathcal F_k^\infty} |\Pr(A\cap B)-\Pr(A)\Pr(B)|.

With stationarity, geometric drift in an VV norm and π(V)<∞\pi(V)<\infty, a Markov chain has geometric absolute-mixing control under the theorem’s assumptions. For a geometrically ergodic chain, a sufficient CLT condition for a functional hh is Eπ∣h∣2+δ<∞\mathbb E_\pi|h|^{2+\delta}<\infty for some δ>0\delta>0; limiting variance includes autocovariances and may be zero. Ergodicity alone does not guarantee that moment. Roberts and Rosenthal’s Theorem 24 gives this sufficient condition.

When the CLT applies and autocovariances are summable, asymptotic variance of n(hˉn−πh)\sqrt n(\bar h_n-\pi h) is γh(0)+2∑k≥1γh(k)\gamma_h(0)+2\sum_{k\ge1}\gamma_h(k); the mean’s standard error is approximately its square root divided by n\sqrt n. In MCMC, counting samples is insufficient: correlations change that error and a tail without required moments can invalidate the approximation.

The block bootstrap preserves local dependence. For the mean, consistency results require moment and dependence assumptions, together with block length ℓ→∞\ell\to\infty and ℓ/n→0\ell/n\to0 in usual regimes. Short blocks discard dependence at longer distances and may underestimate error; with long memory the autocovariance sum may diverge and those conditions are insufficient. They also do not automatically transfer to regime changes. Results for mixing sequences specify conditions for the mean.

Lab: drift we can calculate

The first cell checks AR(1) drift constants analytically on a grid and by simulation. The grid can reveal failures, but proof outside the compact set remains algebraic.

[ ]Quadratic AR(1) driftBrowser
import numpy as np
from scipy.special import ndtr
from scipy.stats import norm, wasserstein_distance

phi, sigma2, lam = .5, 1., .5
R = np.sqrt(6.)
b = 1+sigma2-lam
grid = np.linspace(-10,10,101)
V = 1+grid**2
PV = 1+sigma2+phi**2*grid**2
cota = lam*V+b*(abs(grid)<=R)
print("R, λ, b y máxima violación analítica:", R, lam, b, np.max(PV-cota))
print("otra configuración: b y R", 1+1.2-.6, np.sqrt((1+1.2-.6)/(.6-.6**2)))
rng = np.random.default_rng(15)
ruido = rng.normal(size=(20000,len(grid)))
pv_mc = np.mean(1+(phi*grid[None,:]+ruido)**2,axis=0)
print("error máximo Monte Carlo en la rejilla:", np.max(abs(pv_mc-PV)))

For the SETAR example calculate PVPV without simulation. If Y∼N(m,1)Y\sim N(m,1), E[Y21Y≥0]=(m2+1)Φ(m)+mφ(m)\mathbb E[Y^2\mathbf1_{Y\ge0}]=(m^2+1)\Phi(m)+m\varphi(m). The grid illustrates contraction outside a radius; the proof uses the limits and continuity described above.

[ ]Asymmetric drift in SETARBrowser
a, b_coef = -1.4, -.4
c_neg = .4
def v_setar(x):
    x = np.asarray(x)
    return 1+np.where(x>=0, 1., c_neg)*x*x

def pv_setar(x):
    x = np.asarray(x, dtype=float)
    media = np.where(x>=0, a*x, b_coef*x)
    segundo = 1+media**2
    positivo = segundo*ndtr(media)+media*norm.pdf(media)
    negativo = segundo-positivo
    return 1+positivo+c_neg*negativo

exterior = np.r_[np.linspace(-30,-10,100), np.linspace(10,30,100)]
ratios = pv_setar(exterior)/v_setar(exterior)
print("máximo PV/V en la rejilla exterior:", ratios.max())
print("límites teóricos de los dos lados:", .4*1.4**2, .4**2/.4)
print("productos de otros dos pares:", 1.6*.5, 2*.6)

Now compare finite-time state distributions from two starts. For each model reuse the same seed for both starts: paths are paired by innovations, not independent samples. For AR(1), the stationary normal law has deviation 1/1−ϕ21/\sqrt{1-\phi^2}; with standard Cauchy innovations it has scale 1/(1−∣ϕ∣)1/(1-|\phi|). For SETAR compare the stable case with a point outside the theoretical region. Quantiles and proportions prevent interpreting one extreme path as proof of stability.

[ ]Distributions from different startsBrowser
def finales(modelo, inicio, reps, pasos, rng):
    x = np.full(reps, inicio, dtype=float)
    for _ in range(pasos):
        if modelo == "normal":
            x = .5*x+rng.normal(size=reps)
        elif modelo == "cauchy":
            x = .5*x+rng.standard_cauchy(size=reps)
        elif modelo == "setar estable":
            x = np.where(x>=0, -1.4*x, -.4*x)+rng.normal(size=reps)
        else:
            x = np.where(x>=0, 1.1*x, .2*x)+rng.normal(size=reps)
    return x

for i, modelo in enumerate(("normal", "cauchy", "setar estable", "setar fuera")):
    for inicio in (-8., 8.):
        x = finales(modelo, inicio, 6000, 100, np.random.default_rng(160+i))
        print(modelo, "inicio", inicio, "cuantiles 10, 50, 90:",
              np.round(np.quantile(x,[.1,.5,.9]), 3),
              "fracción |x|>100:", np.mean(abs(x)>100))
print("AR normal: desviación estacionaria", 1/np.sqrt(1-.5**2))
print("AR Cauchy: escala estacionaria", 1/(1-abs(.5)))

The next simulation uses the same noise for two AR(1) chains. Their state distance contracts exactly by ∣ϕ∣|\phi| each step. This demonstrates synchronous distance contraction, not a coupling producing exact equality of two continuous states or a direct total variation estimate.

[ ]Synchronous coupling and Wasserstein distanceBrowser
rng = np.random.default_rng(151)
reps, pasos, phi = 2000, 20, .8
x = np.full(reps,8.)
y = np.full(reps,-8.)
for t in range(1,pasos+1):
    e = rng.normal(size=reps)
    x = phi*x+e
    y = phi*y+e
    if t in (1,5,10,20):
        print("paso, distancia empírica W1 y diferencia teórica:",
              t, wasserstein_distance(x,y), 16*abs(phi)**t)

Lab: Metropolis and bootstrap

Bin Metropolis replications started at 8 and compare their frequencies with exact normal and Cauchy masses. Extreme tails are also bins; binned distance estimates only that summary. Replications are independent, but values at different times within one replication are related.

[ ]Metropolis on two targetsBrowser
from scipy.stats import cauchy

def log_objetivo(x, tipo):
    return -.5*x*x if tipo == "normal" else -np.log1p(x*x)

def rwm_agrupado(tipo, reps, pasos, rng):
    bordes = np.r_[-np.inf, np.linspace(-8,8,17), np.inf]
    cdf = norm.cdf if tipo == "normal" else cauchy.cdf
    objetivo = np.diff(cdf(bordes))
    x = np.full(reps,8.)
    salidas = {}
    aceptados = 0
    for t in range(1,pasos+1):
        propuesta = x+rng.normal(size=reps)
        loga = log_objetivo(propuesta,tipo)-log_objetivo(x,tipo)
        acepta = np.log(rng.random(reps)) < np.minimum(0.,loga)
        x = np.where(acepta,propuesta,x)
        aceptados += np.sum(acepta)
        if t in (10,50,200):
            masa = np.histogram(x,bins=bordes)[0]/reps
            salidas[t] = .5*np.abs(masa-objetivo).sum()
    return salidas, aceptados/(reps*pasos)

for tipo in ("normal", "cauchy"):
    distancias, aceptacion = rwm_agrupado(tipo, 4000, 200, np.random.default_rng(152))
    print(tipo, "distancias agrupadas:", distancias, "aceptación media:", aceptacion)

The next bootstrap compares an approximately stationary AR(1) path with the exact finite theoretical standard error of its mean. Sampling blocks of length one is equivalent here to resampling observations individually. Figures from one path and finitely many replications fluctuate; they do not by themselves prove coverage or consistency.

[ ]Block length and mean errorBrowser
rng = np.random.default_rng(153)
phi, n, burn = .8, 400, 300
z = 0.
datos = []
for t in range(n+burn):
    z = phi*z+rng.normal()
    if t >= burn:
        datos.append(z)
datos = np.array(datos)
h = np.arange(1,n)
var_marginal = 1/(1-phi**2)
var_media = var_marginal/n*(1+2*np.sum((1-h/n)*phi**h))

def bootstrap_bloques(x, largo, reps, rng):
    n = len(x)
    if not 1 <= largo <= n:
        raise ValueError("longitud inválida")
    bloques = (n+largo-1)//largo
    comienzos = rng.integers(0, n-largo+1, size=(reps,bloques))
    indices = comienzos[:,:,None]+np.arange(largo)
    remuestreadas = x[indices].reshape(reps,-1)[:,:n]
    return remuestreadas.mean(axis=1)

print("error estándar teórico de la media:", np.sqrt(var_media))
for largo in (1,8,32):
    medias = bootstrap_bloques(datos,largo,600,rng)
    print("longitud, desviación bootstrap:", largo, medias.std(ddof=1))

Exercises

ProofConstructing geometric drift
Prove: For Xₜ₊₁=φXₜ+εₜ₊₁, |φ|<1, with state-independent innovations E[ε]=0 and Var(ε)=σ²<∞, prove a drift condition for V(x)=1+x². Explain what else is needed to conclude geometric ergodicity.
0
Choose λ strictly between φ² and one.

Step 1 of 3. What is PV(x)?

NumericConstant within the compact set
For φ=0.6, σ²=1.2, V(x)=1+x² and λ=0.6, take C=[−√(20/3),√(20/3)]. What b gives PV≤λV+b·1C using the maximum of PV−λV on C?
ProofA bottleneck in the tail
Prove: Sketch why random-walk Metropolis with a fixed normal proposal and Cauchy target is not geometrically ergodic.
0
Consider A_R=[R,∞) and separate the layer [R,R+√R] from the rest.

Step 1 of 3. What happens to relative mass of the layer near the boundary, π([R,R+√R])/π([R,∞))?

QuizWhich regime brings the chain back?
In the zero-threshold Gaussian SETAR described in the lesson, which pair belongs to the strict stability region?
CodeExplore drift on a grid
Implement check_drift(kernel_sampler, V, grid, lam, b, in_C, reps): for each x, call kernel_sampler(x, reps), estimate PV(x) by the mean of V over samples, and return points where PV(x)>lam·V(x)+b·in_C(x). kernel_sampler returns an array, V accepts scalars and arrays, and in_C returns an indicator. Require positive reps and 0<lam<1. A Monte Carlo grid does not prove the global inequality.
import numpy as np

def check_drift(kernel_sampler, V, grid, lam, b, in_C, reps):
  pass
Shift+Enter to run
Key idea

On a general space, a kernel describes transitions; irreducibility and small sets connect state regions. Lyapunov drift controls return and, with suitable assumptions, provides geometric ergodicity and tools for studying dependent averages.