/ interactive_tutorials / mcmc_sonification
Sign in
interactive_tutorials / mcmc_sonification
mcmc_sonification / README.md
6.4 KBPreviewCodeBlameHistoryRaw

Listening for convergence#

A minimal lab for hearing MCMC chains reach (or fail to reach) their stationary distribution, on a 2D mixture of two normals:

p(θ) = ½ 𝒩(θ | m₁, Σ₁) + ½ 𝒩(θ | m₂, Σ₂), m₁,₂ = (∓μ/2, 0), Σₖ = diag(σₖ) [[1, ρₖ], [ρₖ, 1]] diag(σₖ)

npm run dev     # serves app/ at http://127.0.0.1:8003
npm run check   # node --check on every module, and runs the sampler check
node scripts/check-samplers.mjs   # acceptance, mode switches and moments on the five targets

Static index.html, style.css and ES modules, no build step; fonts bundled under app/vendor/.

What's in it#

Things to try (from the notes): RWM on separated with ε = 0.1, 0.75, 2 and 4; GHMC at ε = 0.2 sweeping γ from 1 down to 0.01; HMC on ridge at ε = 0.5 (above the 0.45 limit: frozen); ULA on ridge at ε = 0.75 (diverges); every gradient sampler on stiff (they never find the needle; RWM with ε ≈ 2 does). There, MALA at ε = 0.5 gives split R̂ ≈ 1.00 while P(θ₁ > 0) is about 0.02 against ½: all chains agree, on the wrong answer, and they all keep to the low register. Start all chains in one mode of separated by clicking it, and listen for the first to cross.

Code#

↑↓ move↵openescclose