Slide 1

Slide 1 text

Typical Sets: What They Are and How to (Hopefully) Find Them Josh Speagle [email protected] Based on this talk by Michael Betancourt at StanCon.

Slide 2

Slide 2 text

Intended Audience • Some experience with the basics of Bayesian statistics.

Slide 3

Slide 3 text

Intended Audience • Some experience with the basics of Bayesian statistics. • Some experience using MCMC for research.

Slide 4

Slide 4 text

Intended Audience • Some experience with the basics of Bayesian statistics. • Some experience using MCMC for research. • Have heard of ensemble sampling methods such as emcee.

Slide 5

Slide 5 text

Bayesian Inference

Slide 6

Slide 6 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem

Slide 7

Slide 7 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Parameters

Slide 8

Slide 8 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Data Parameters

Slide 9

Slide 9 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Data Parameters Model

Slide 10

Slide 10 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem

Slide 11

Slide 11 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Prior

Slide 12

Slide 12 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Prior Likelihood

Slide 13

Slide 13 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Prior Likelihood Posterior

Slide 14

Slide 14 text

Bayesian Inference Pr , M = Pr , M Pr |M Pr M Bayes’ Theorem Prior Likelihood Posterior Evidence

Slide 15

Slide 15 text

Bayesian Inference = ℒ Bayes’ Theorem ≡ Ω ℒ Posterior Likelihood Prior Evidence

Slide 16

Slide 16 text

Bayesian Inference = ℒ Bayes’ Theorem Posterior Likelihood Prior Evidence ≡ Ω ℒ

Slide 17

Slide 17 text

Where is the posterior? ≡ Ω

Slide 18

Slide 18 text

Where is the posterior? ≡ {: =}

Slide 19

Slide 19 text

Where is the posterior? ≡ 0 ∞

Slide 20

Slide 20 text

Where is the posterior? ≡ 0 ∞ =

Slide 21

Slide 21 text

Where is the posterior? ≡ 0 ∞ “Amplitude” “Volume” =

Slide 22

Slide 22 text

= Where is the posterior? ≡ 0 ∞ “Typical Set”

Slide 23

Slide 23 text

Typical Sets: Gaussian Example

Slide 24

Slide 24 text

Typical Sets: Gaussian Example ∝ 0 ∞ − 2 2

Slide 25

Slide 25 text

Typical Sets: Gaussian Example ∝ 0 ∞ − 2 2 ∝ 0 ∞ − 2 2 −1

Slide 26

Slide 26 text

Typical Distance Typical Sets: Gaussian Example

Slide 27

Slide 27 text

= Where is the posterior? ≡ 0 ∞ “Typical Set”

Slide 28

Slide 28 text

= Where is the posterior? ≡ 0 ∞ “Typical Set”

Slide 29

Slide 29 text

= Where is the posterior? ≡ 0 ∞ “Typical Set”

Slide 30

Slide 30 text

= Where is the posterior? ≡ 0 ∞ “Typical Set” MCMC wants to draw samples from this “shell”

Slide 31

Slide 31 text

Tension in the Metropolis Update ′ = min 1, ′ ′ ′

Slide 32

Slide 32 text

Tension in the Metropolis Update ′ = min 1, ′ ′ ′ Proposal

Slide 33

Slide 33 text

Tension in the Metropolis Update ′ = min 1, ′ ′ ′ “Volume”

Slide 34

Slide 34 text

Tension in the Metropolis Update ′ = min 1, ′ ′ ′ “Volume” “Amplitude”

Slide 35

Slide 35 text

Metropolis-Hastings

Slide 36

Slide 36 text

Metropolis-Hastings ′ = Normal ′ = , =

Slide 37

Slide 37 text

Metropolis-Hastings ′ = Normal ′ = , = Typical Distance

Slide 38

Slide 38 text

Metropolis-Hastings ′ = Normal ′ = , = Typical Distance

Slide 39

Slide 39 text

Metropolis-Hastings ′ = Normal ′ = , =

Slide 40

Slide 40 text

Metropolis-Hastings ′ = Normal ′ = , =

Slide 41

Slide 41 text

Ideal Metropolis-Hastings ′ = Normal ′ = , = Typical Separation

Slide 42

Slide 42 text

Ideal Metropolis-Hastings ′ = Normal ′ = , = Typical Separation M-H

Slide 43

Slide 43 text

Ideal Metropolis-Hastings ′ = Normal ′ = , = s Typical Separation Adaptive M-H

Slide 44

Slide 44 text

Ensemble Sampling

Slide 45

Slide 45 text

Ensemble Sampling

Slide 46

Slide 46 text

Ensemble Sampling

Slide 47

Slide 47 text

Ensemble Sampling

Slide 48

Slide 48 text

Ensemble Sampling

Slide 49

Slide 49 text

Ensemble Sampling

Slide 50

Slide 50 text

emcee ′ = min 1, ′ −1 ~ = 1 from 1 , 0 otherwise “Stretch” factor

Slide 51

Slide 51 text

Ideal Typical Separation emcee M-H

Slide 52

Slide 52 text

Ideal Typical Separation emcee M-H emcee

Slide 53

Slide 53 text

Ideal Typical Separation emcee M-H emcee

Slide 54

Slide 54 text

Ideal Typical Separation emcee M-H emcee After weighting by acceptance probability

Slide 55

Slide 55 text

emcee ′ = min 1, ′ −1 ~ = 1 from 1 , 0 otherwise “Stretch” factor

Slide 56

Slide 56 text

emcee ′ = min 1, ′ −1 ~ = 1 from 1 , 0 otherwise “Stretch” factor 

Slide 57

Slide 57 text

Summary • Volume scales as . • The posterior density depends on both volume and amplitude. • Most of the posterior is concentrated in a “shell” around the best solution called the typical set. • MCMC draws samples from the typical set.

Slide 58

Slide 58 text

But what about corner plots?

Slide 59

Slide 59 text

But what about corner plots? 2-dimensional projection of D-dimensional shell

Slide 60

Slide 60 text

But what about corner plots? 2-dimensional projection of D-dimensional shell

Slide 61

Slide 61 text

But what about corner plots? 2-dimensional projection of D-dimensional shell

Slide 62

Slide 62 text

Hamiltonian Monte Carlo

Slide 63

Slide 63 text

Hamiltonian Monte Carlo

Slide 64

Slide 64 text

Hamiltonian Monte Carlo

Slide 65

Slide 65 text

Hamiltonian Monte Carlo Treat the particle at position q as a point mass with mass matrix M and momentum p. Pr , ∝ , = − −1 2 Hamiltonian

Slide 66

Slide 66 text

Hamiltonian Monte Carlo Pr , ∝ , = − −1 2 Treat the particle at position q as a point mass with mass matrix M and momentum p. = = −1 = − = ln Hamiltonian Hamilton’s Equations

Slide 67

Slide 67 text

Hamiltonian Monte Carlo ′, −′ , = min 1, Pr ′, −′ Pr , ∼ Normal = , =

Slide 68

Slide 68 text

Typical Distance Hamiltonian Monte Carlo ∼ Normal = , =

Slide 69

Slide 69 text

Typical Distance Hamiltonian Monte Carlo ∼ Normal = , =

Slide 70

Slide 70 text

Ideal Typical Separation M-H emcee Hamiltonian Monte Carlo ∼ Normal = , =

Slide 71

Slide 71 text

Ideal Typical Separation M-H emcee Hamiltonian Monte Carlo ∼ Normal = , = HMC