Positive Curvature and Hamiltonian Monte Carlo · Positive Curvature and Hamiltonian Monte Carlo...

1
Positive Curvature and Hamiltonian Monte Carlo Christof Seiler, Simon Rubinstein-Salzedo, and Susan Holmes Department of Statistics, Stanford University Goal Running time estimates for sampling from high di- mensional probability distributions using Hamilto- nian Monte Carlo (HMC). Hamiltonian Monte Carlo Bayesian posterior distribution: π (q | data) = 1 Z L(data | q ) π (q ) parameter q R d , d observations, and unknown normalizing constant Z . Expectation of f : R d R I := E π (f )= Z f (q ) π (q | data) dq Empirical mean: b I := 1 T T X t=1 Q t , Q 1 ,...,Q T π (q | data) simulated using HMC for running time T HMC algorithm: Metropolis-Hastings with proposal step following Hamiltonian trajectories Error and running time: Bound the error | b I - I | as a function of the running time T Sectional Curvature Sectional curvature Sec describes the nature of geodesics x δ 1 - " 2 2 Sec x (u , v )+ O (" 3 + " 2 δ ) Sec x (u , v ) > 0 Positive curvature: geodesics meet Flat and negative curvature: geodesics deviate Probability Meets Geometry Coarse Ricci curvature κ describes the deviation from independence of subsequent draws from Markov chain Monte Carlo The larger κ the more independent The larger κ the smaller T for the same error We calculate the κ of HMC Concentration inequality (JO10) P | b I - I |≥ r f Lip 2e -r 2 /(16V 2 (κ,T )) Jacobi Metric Jacobi metric g h links Hamiltonians to Riemannian geometry Hamiltonian function: h = V (q )+ K (p) Potential energy: V (q )= - log π (q | data) + C Kinetic energy: K (p)= 1 2 p, p Hamiltonian equations: dq dt = ∂H ∂p and dp dt = - ∂H ∂q Jacobi-Maupertuis Principle: q (t ) T q X p (0) q (0) Hamiltonian trajectories q (t) with fixed h are geodesics on Riemannian manifolds X with the Jacobi metric: g h (p, p)=2(h - V ) p, p. HMC Meets Geometry Reference metric ·, · Conformal scaling of a metric 2(h - V ) Equivalence table: HMC Riemannian geometry posterior distribution scaling of reference metric covariance of proposal reference metric pick from proposal geodesics Gaussian Example HMC sampling from a Gaussian in R d with zero mean and covariance matrix Λ -1 Calculate sectional curvature of Jacobi metric Sec is random because p is random Calculate coarse Ricci curvature from Sec Our Lemma on positive curvature of HMC: P(d 2 Sec K 1 ) 1 - K 2 e -K 3 d Our Corollary in high dimensions: Sec Tr(Λ) d 3 as d →∞ Our Proposal on coarse Ricci curvature of HMC: κ Tr(Λ) 6d 2 + O 1 d 2 as d →∞ Numerical simulations: Sample Sec’s uniformly at each step, q (0),...,q (T - 1) Histogram of sectional curvatures (d = 100) Frequency 0.00005 0.00015 0.00025 0.00035 0 20000 40000 60000 expectation E(Sec) sample mean expectation E(Sec) sample mean (d = 10) (d = 1000) 0 0 -3 3 10 -6 Computational Anatomy Conclusion Linking HMC to geodesics of the Jacobi metric en- ables us to analyze HMC through the rich mathe- matical framework of Riemannian geometry. References (JO10) A. Joulin and Y. Ollivier. Curvature, Concentration and Error Estimates for Markov Chain Monte Carlo. Ann. Probab., 2010. (Pin75) O. C. Pin. Curvature and Mechanics. Advances in Math., 1975. Acknowledgments CS is supported by a postdoctoral fellowship from the Swiss Na- tional Science Foundation and a travel grant from the France- Stanford Center. SRS and SH are supported by NIH grant R01- GM086884.

Transcript of Positive Curvature and Hamiltonian Monte Carlo · Positive Curvature and Hamiltonian Monte Carlo...

Page 1: Positive Curvature and Hamiltonian Monte Carlo · Positive Curvature and Hamiltonian Monte Carlo Christof Seiler, Simon Rubinstein-Salzedo, and Susan Holmes Department of Statistics,

Positive Curvature and Hamiltonian Monte CarloChristof Seiler, Simon Rubinstein-Salzedo, and Susan Holmes

Department of Statistics, Stanford University

GoalRunning time estimates for sampling from high di-mensional probability distributions using Hamilto-nian Monte Carlo (HMC).

Hamiltonian Monte Carlo

Bayesian posterior distribution:π(q | data) = 1

Z L(data | q) π(q)parameter q ∈ Rd, d� observations, andunknown normalizing constant Z.

Expectation of f : Rd→ R

I := Eπ(f ) =∫f (q) π(q | data) dq

Empirical mean:̂I := 1

T

T∑

t=1Qt, Q1, . . . , QT ∼ π(q | data)

simulated using HMC for running time THMC algorithm: Metropolis-Hastings with proposal

step following Hamiltonian trajectoriesError and running time: Bound the error | ̂I − I| as

a function of the running time T

Sectional Curvature

Sectional curvature Sec describes the nature ofgeodesics

x

✓1 � "2

2Secx(u, v) + O("3 + "2�)

Secx(u, v) > 0

Positive curvature: geodesics meetFlat and negative curvature: geodesics deviate

Probability Meets Geometry

Coarse Ricci curvature κ describes the deviationfrom independence of subsequent draws fromMarkov chain Monte Carlo•The larger κ the more independent•The larger κ the smaller T for the same error•We calculate the κ of HMC

Concentration inequality (JO10)P(| ̂I − I| ≥ r‖f‖Lip

)≤ 2e−r2/(16V 2(κ,T ))

Jacobi Metric

Jacobi metric gh links Hamiltonians to Riemanniangeometry

Hamiltonian function:h = V (q) + K(p)

Potential energy:V (q) = − log π(q | data) + C

Kinetic energy:K(p) = 1

2 〈p, p〉Hamiltonian equations:

dq

dt= ∂H

∂pand dp

dt= −∂H

∂q

Jacobi-Maupertuis Principle:

q(t)

TqX

p(0) q(0)

Hamiltonian trajectories q(t) with fixed h aregeodesics on Riemannian manifolds X with theJacobi metric:

gh(p, p) = 2 (h− V ) 〈p, p〉.

HMC Meets Geometry

Reference metric 〈·, ·〉Conformal scaling of a metric 2 (h− V )Equivalence table:

HMC Riemannian geometryposterior distribution scaling of reference metriccovariance of proposal reference metricpick from proposal geodesics

Gaussian Example

•HMC sampling from a Gaussian in Rd with zeromean and covariance matrix Λ−1

•Calculate sectional curvature of Jacobi metric• Sec is random because p is random•Calculate coarse Ricci curvature from SecOur Lemma on positive curvature of HMC:

P(d2 Sec ≥ K1) ≥ 1−K2e−K3√d

Our Corollary in high dimensions:

Sec ≥ Tr(Λ)d3 as d→∞

Our Proposal on coarse Ricci curvature of HMC:

κ ≥ Tr(Λ)6d2 + O

1d2

as d→∞

Numerical simulations: Sample Sec’s uniformly ateach step, q(0), . . . , q(T − 1)

Histogram of sectional curvatures (d = 100)

Freq

uenc

y

0.00005 0.00015 0.00025 0.00035

020

000

4000

060

000

expectation E(Sec)sample mean

Histogram of sectional curvatures (d = 10)

Freq

uenc

y

−3 −2 −1 0 1 2 3 4

020

000

4000

060

000

8000

0

expectation E(Sec)sample mean

���������

��������� ������ �� ���������� �� � �����

���� ������ ������ ������

������

������

������ ����������� ������

������ ����

(d = 10)

(d = 1000)

0

0-3 3

10-6

Computational Anatomy

ConclusionLinking HMC to geodesics of the Jacobi metric en-ables us to analyze HMC through the rich mathe-matical framework of Riemannian geometry.

References

(JO10) A. Joulin and Y. Ollivier. Curvature, Concentrationand Error Estimates for Markov Chain Monte Carlo. Ann.Probab., 2010.

(Pin75) O. C. Pin. Curvature and Mechanics. Advances inMath., 1975.

Acknowledgments

CS is supported by a postdoctoral fellowship from the Swiss Na-tional Science Foundation and a travel grant from the France-Stanford Center. SRS and SH are supported by NIH grant R01-GM086884.