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
- 26Markov propertyStationary distributionMarkov chain convergence theoremErgodic theorem for Markov chainsMarkov chain central limit theorem and asymptotic varianceAutoregressive modelCausality and invertibility
- 04Measure and measure spaceLebesgue integralRegular conditional distributionTotal variation distance
- 05Block bootstrap
- 03Lyapunov function
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.
Kernels and sufficient states
A transition kernel is a probability on for each state and is measurable in for each measurable set . It acts on functions and measures through
Invariance is . In with innovation density , . For a two-regime SETAR, replace with transition function 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 , , and , the pair is a Markov state if innovations are iid and independent of the past. For to be conditional variance, also take and . If has law and , its kernel is
The 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 -irreducible if from any state it can reach every measurable set of positive measure with positive probability in some number of steps that may depend on state and set. Measure 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 is small if there exist , and a probability such that
That minorization decomposes the transition into a common and residual part. On visiting , an auxiliary construction can regenerate from with probability ; 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 is small: density is continuous and positive, so it has a positive minimum on . Taking 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 , , and a small set such that
Outside , the expected value of contracts; inside it may increase but remains controlled. With irreducibility, aperiodicity, an invariant distribution and corresponding finiteness assumptions, drift and minorization imply geometric ergodicity:
for states covered by the theorem. Factor may grow with the initial state; it is not a uniform bound across the space. An inequality for a function without minorization and irreducibility is insufficient. Roberts and Rosenthal present the theorem and its conditions.
For an AR(1) with , state-independent centered innovations of variance , and ,
Choose any and with . For , outside we have , and inside 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, for that quadratic . Do not conclude instability: for , has finite expectation and gives drift coefficient . 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
For this two-regime, zero-threshold family, the strict stability region is , and . 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 and , the positive regime has modulus greater than one, but a large positive state jumps negative and over the next step is multiplied overall by without noise. A symmetric quadratic does not prove one-step drift on the positive side. Instead use if and if . At large absolute values, dominant ratios tend to on the positive side and 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 . Positive density allows minorization on compact sets.
Metropolis and what a rate means
In random-walk Metropolis propose with symmetric density and accept with probability . The chain preserves 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 with . 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.
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 steps. For example,
With stationarity, geometric drift in an norm and , 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 is for some ; 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 is ; the mean’s standard error is approximately its square root divided by . 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 and 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.
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 without simulation. If , . The grid illustrates contraction outside a radius; the proof uses the limits and continuity described above.
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 ; with standard Cauchy innovations it has scale . 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.
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 each step. This demonstrates synchronous distance contraction, not a coupling producing exact equality of two continuous states or a direct total variation estimate.
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.
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.
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
Step 1 of 3. What is PV(x)?
Step 1 of 3. What happens to relative mass of the layer near the boundary, π([R,R+√R])/π([R,∞))?
import numpy as np
def check_drift(kernel_sampler, V, grid, lam, b, in_C, reps):
passOn 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.