The Bouncy Particle Sampler: A Non-Reversible Rejection-Free Markov Chain Monte Carlo Method
Alexandre Bouchard-Côté, Sebastian J. Vollmer, Arnaud Doucet
Introduction
However, the implementation of the BPS proposed in is not applicable to most target distributions arising in statistics. In this article we make the following contributions:
by reformulating explicitly the bounces times of the BPS as the first arrival times of inhomogeneous Poisson Processes (PP), we leverage standard sampling techniques [8, Chapter 6] and methods from chemical kinetics to obtain new computationally efficient ways to simulate the BPS process for a large class of target distributions.
when the target distribution can be expressed as a factor graph , a representation generalizing graphical models where the target is given by a product of factors and each factor can be a function of only a subset of variables, we adapt a physical multi-particle system method discussed in [27, Section III] to achieve additional computational efficiency. This local version of the BPS only manipulates a restricted subset of the state components at each bounce but results in a change of all state components, not just the one being updated contrary the Gibbs sampler.
we present a proof of the ergodicity of BPS when the velocity of the particle is additionally refreshed at the arrival times of an homogeneous PP. When this refreshment step is not carried out, we exhibit a counter-example where ergodicity does not hold.
we propose alternative refreshment schemes and compare their computational efficiency experimentally.
Empirically, these new MCMC schemes compare favorably to state-of-the-art MCMC methods on various Bayesian inference problems, including for high-dimensional scenarios and large data sets. Several additional original extensions of the BPS including versions of the algorithm which are applicable to mixed continuous-discrete distributions, distributions restricted to a compact support and a method relying on the use of curved dynamics instead of straight lines can be found in . For brevity, these are not discussed here.
The rest of this article is organized as follows. In Section 2, we introduce the basic version of the BPS, propose original ways to implement it and prove its ergodicity under weak assumptions. Section 3 presents a modification of the basic BPS which exploits a factor graph representation of the target distribution and develops computationally efficient implementations of this scheme. In Section 4, we demonstrate this methodology on various Bayesian models. The proofs are given in the Appendix and the Supplementary Material.
The bouncy particle sampler
2 Algorithm description
When the particle bounces, its velocity is updated in the same way as a Newtonian elastic collision on the hyperplane tangential to the gradient of the energy. Formally, the velocity after bouncing is given by
3 Algorithms for bounce time simulation
Implementing BPS requires sampling the first arrival time of a one-dimensional inhomogeneous PP of intensity given by (1). Simulating such a process is a well-studied problem; see [8, Chapter 6, Section 1.3]. We review here three methods and illustrate how they can be used to implement BPS for examples from Bayesian statistics. The first method described in Section 2.3.1 will be particularly useful when the target is log-concave, while the two others described in Section 2.3.2 and Section 2.3.3 can be applied to more general scenarios.
If we let , then the PP satisfies
and therefore can be simulated from a uniform variate via the identity
where denotes the quantile function of \varXi^{-1}(p)=\inf\mbox{\left\{t:p\leq\varXi(t)\right\}}. Refer to Figure 1, top right for a graphical illustration. This identity corresponds to the method proposed in to determine the bounce times and is also used in to simulate related processes.
In general, it is not possible to obtain an analytical expression for . However, when the target distribution is strictly log-concave and differentiable, it is possible to solve Equation (5) numerically (see Example 1 below).
Log-concave densities. If the energy is strictly convex (see Figure 1, bottom right), we can minimize it along the line specified by
where is well defined and unique by strict convexity. On the interval , which might be empty, we have and on \left[\tau_{*},\text{\infty}\right). The solution of (5) is thus necessarily such that and (5) can be rewritten using the gradient theorem as
Even if we only compute pointwise through a black box, we can solve (6) through line search within machine precision.
We note that (6) also provides an informal connection between the BPS and MH algorithms. Exponentiating this equation, we get indeed
Hence, in the log-concave case, and when the particle is climbing the energy ladder (i.e., ), BPS can be viewed as “swapping” the order of the steps taken by the MH algorithm. In the latter, we first sample a proposal and second sample a uniform to perform an accept-reject decision. With BPS, is first drawn then the maximum distance allowed by the same MH ratio is travelled. As for the case of a particle going down the energy ladder, the behavior of BPS is simpler to understand: bouncing never occurs. We illustrate this method for Gaussian distributions.
Multivariate Gaussian distributions. Let , then simple calculations yield
3.2 Simulation using adaptive thinning
When it is difficult to solve (5), the use of an adaptive thinning procedure provides an alternative. Assume we have access to local-in-time upper bounds on , that is
where is a positive function (standard thinning corresponds to ). Assume additionally that we can simulate the first arrival time of the PP with intensity . Such bounds can be constructed based on upper bounds on directional derivatives of provided the remainder of the Taylor expansion can be controlled. Algorithm 2 shows the pseudocode for the adaptive thinning procedure.
The case corresponds to a rejection step in the thinning algorithm but, in contrast to rejection steps that occur in standard MCMC samplers, in the BPS algorithm this means that the particle does not bounce and just coasts. Practically, we would like ideally and the ratio to be large. Indeed this would avoid having to simulate too many candidate events from which would be rejected as these rejection steps incur a computational cost.
3.3 Simulation using superposition and thinning
Assume that the energy can be decomposed as
where for . It is therefore possible to use the thinning algorithm of Section 2.3.2 with for (and ), as we can simulate from via superposition by simulating the first arrival time of each PP with intensity then returning
Exponential families. Consider a univariate exponential family with parameter , observation sufficient statistic and log-normalizing constant . If we assume a Gaussian prior on we obtain
The time is computed analytically in Example 1 whereas the times and are given by
Using the superposition and thinning method (Section 2.3.3), simulation of the bounce times can be broken into subproblems corresponding to factors: one factor coming from the prior, with corresponding energy
and factors coming from the likelihood of each datapoint, with corresponding energy
Simulation of is covered in Example 1. Simulation of for can be approached using thinning. In Appendix C.1, we show that
Since the bound is constant for a given , we sample by simulating an exponential random variable.
4 Estimating expectations
see, e.g., . When , , we have
When the above integral is intractable, we may just discretize at regular time intervals to obtain an estimator
where is the mesh size and . Alternatively, we could approximate these univariate integrals through quadrature.
5 Theoretical results
If we add the condition , we get the following stronger result.
The local bouncy particle sampler
In numerous applications, the target distribution admits some structural properties that can be exploited by sampling algorithms. For example, the Gibbs sampler takes advantage of conditional independence properties. We present here a “local” version of the BPS introduced in [27, Section III] which can similarly exploit these properties and, more generally, any representation of the target density as a product of positive factors
where is a restriction of to a subset N_{f}\subseteq\mbox{\lx@text@lbrace 1,2,\dotsd\}} of the components of , and is an index set called the set of factors. Hence the energy associated to is of the form
with for any variable absent from factor , i.e. for any .
Such a factorization of the target density can be formalized using factor graphs (Figure 2, top). A factor graph is a bipartite graph, with one set of vertices called the variables, each corresponding to a component of (), and a set of vertices corresponding to the local factors . There is an edge between and if and only if This representation generalizes undirected graphical models [32, Chap. 2, Section 2.1.3] as, for example, factor graphs can have distinct factors connected to the same set of components (i.e. with ) as in the example of Section 4.6.
2 Local BPS: algorithm description
Similarly to the Gibbs sampler, each step of the local BPS manipulates only a subset of the components of . Contrary to the Gibbs sampler, the local BPS does not require sampling from any full conditional distribution and each local calculation results in a change of all state components, not just the one being updated—how this can be done implicitly without manipulating the full state at each iteration is described below. Related processes exhibiting similar characteristics have been proposed in .
We can check that satisfies
We define a collection of PP intensities based on the previous event position and velocity : . In the local BPS, the next bounce time is the first arrival of a PP with intensity . However, instead of modifying all velocity variables at a bounce as in the basic BPS, we sample a factor with probability and modify only the variables connected to the sampled factor. More precisely, the velocity is updated using defined in (18). A generalization of the proof of Proposition 1 given in the Supplementary Material shows that the local BPS algorithm results in a invariant kernel. In the next subsection, we describe various computationally efficient procedures to simulate this process.
For all these implementations, it is useful to encode trajectories in a sparse fashion: each variable only records information at the times where an event (a bounce or refreshment) affected it. By (19), this represents a sublist of the list of all event times. At each of those times the component’s position and velocity right after the event is stored. Let denote a list of triplets , where and denote the initial position and velocity and (see Figure 2, where the black dots denote the set of recorded triplets). This list is sufficient to compute for . This procedure is detailed in Algorithm 3 and an example is shown in Figure 2, where the black square on the first variable’s trajectory shows how Algorithm 3 reconstructs at a fixed time : it identifies as the index associated to the largest event time before time affecting and return .
3 Local BPS: efficient implementations
We can sample arrivals from a PP with intensity using the superposition method of Section 2.3.3, the thinning step therein being omitted. To implement this technique efficiently, we store potential future bounce times (called “candidates”) , one for each factor, in a priority queue : only a subset of these candidates will join the lists which store past, “confirmed” events. We pick the the smallest time in to determine the next bounce time and the next factor to modify. The priority queue structure ensures that finding the minimum element of or inserting/updating an element of can be performed with computational complexity . When a bounce occurs, a key observation behind efficient implementation of the local BPS is that not all the other candidate bounce times need to be resimulated. Suppose that the bounce was associated with factor . In this case, only the candidate bounce times corresponding to factors with need to be resimulated. For example, consider the first bounce in Figure 2 (shown in purple), which is triggered by factor (rectangles represent candidate bounce times ; dashed lines connect bouncing factors to the variables that undergo an associated velocity change). Then only the velocities for the variables and need to be updated. Therefore, only the candidate bounce times for factors and need to be re-simulated while the candidate bounce time for stays constant (this is shown by an exclamation mark in Figure 2).
The method is detailed in Algorithm 4. Several operations of the BPS such as step 4, 6.iii, 6.iv and 7.ii can be easily parallelized.
3.2 Implementation via thinning
When the number of factors involved in Step 6(d)iv is large, the previous queue-based implementation can be computationally expensive. Implementing the local BPS in this setup is closely related to the problem of simulating stochastic chemical kinetics and innovative solutions have been proposed in this area. We adapt here the algorithm proposed in to the local BPS context. For ease of presentation, we present the algorithm without refreshment and only detail the simulation of the bounce times. This algorithm relies on the ability to compute local-in-time upper bounds on for all . More precisely, we assume that given a current position and velocity , and , we can find a positive number , such that for any , we have . We can also use this method on a subset of and combine it with the previously discussed techniques to sample candidate bounce times for factors in \ but we restrict ourselves to to simplify the presentation.
Algorithm 6 will be particularly useful in scenarios where summing over the bounds (Step 5a) and sampling a factor (Step 5(c)ii) can be performed efficiently. A scenario where it is possible to implement these two operations in constant time is detailed in Section 4.6. Another scenario where sampling quickly from is feasible is if the number of distinct upper bounds is much smaller than the number of factors. For example, we only need to sample a factor uniformly at random if for all in and (that is no factor needs to be inspected in order to execute Algorithm 5(c)ii) and the thinning procedure in Step 5(c)iii boils down to
A related approach has been adopted in for the analysis of big data. In this particular scenario, an alternative local BPS can also be implemented where factors are sampled uniformly at random without replacement from , the thinning occurs with probability
and the components of belonging to bounce based on . One can check that the resulting dynamics preserves as an invariant distribution. In contrast to , this is not an implementation of local BPS described in Algorithm 6, but instead this corresponds to a local BPS update for a random partition of the factors.
Numerical results
We consider an isotropic multivariate Gaussian target distribution, , to illustrate the need for refreshment. Without refreshment, we obtain from Equation (7)
In this scenario, we show that BPS without refreshment admits a countably infinite collection of invariant distributions. Let us define and and denote by the probability density of the chi distribution with degrees of freedom.
For any dimension , the process is Markov and its transition kernel is invariant with respect to the probability densities .
Next, we look at the scaling of the Effective Sample Size (ESS) per CPU second of the basic BPS algorithm for when as the dimension of the isotropic normal target increases. The ESS is estimated using the R package mcmcse by evaluating the trajectory on a fine discretization of the sampled trajectory. The results in log-log scale are displayed in Figure 3. The curve suggests a decay of roughly , slightly inferior to the scaling for an optimally tuned Hamiltonian Monte Carlo (HMC) algorithm [6, Section III], [24, Section 5.4.4]. It should be noted that BPS achieves this scaling without varying any tuning parameter, whereas HMC’s performance critically depends on tuning two parameters (leap-frog stepsize and number of leap-frog steps). Both BPS and HMC compare favorably to the scaling of the optimally tuned random walk MH .
2 Comparison of the global and local schemes
We compare the basic “global” BPS of Section 2 to the local BPS of Section 3 on a sparse Gaussian field. We use a chain-shaped undirected graphical model of length and perform separate experiments for various pairwise precision parameters for the interaction between neighbors in the chain. Both methods are run for 60 seconds. We compare the Monte Carlo estimate of the variance of to its true value. The results are shown in Figure 4. The smaller computational complexity per local bounce of the local BPS offsets significantly the associated decrease in expected trajectory segment length. Moreover, both versions appear insensitive to the pairwise precision used in this sparse Gaussian field.
3 Comparisons of alternative refreshment schemes
In Section 2, the velocity was refreshed using a Gaussian distribution. We compare here this global refreshment scheme to three alternatives:
if the local BPS is used, the factor graph structure can be exploited to design computationally cheaper refreshment operators. We pick one factor uniformly at random and resample only the components of with indices in . By the same argument used in Section 3, each refreshment requires bounce time recomputation only for the factors with .
the velocities are refreshed according to , the uniform distribution on , and the BPS admits now as invariant distribution.
a variant of restricted refreshment where we sample an angle by multiplying a Beta(, )-distributed random variable by We then select a vector uniformly at random from the unit length vectors that have an angle from . We used to favor small angles.
One limitation of the results in this section is that the optimal refreshment scheme and refreshment rate will in general be problem dependent. Adaptation methods used in the HMC literature could potentially be adapted to this scenario , but we leave these extensions to future work.
4 Comparisons with HMC methods on high-dimensional Gaussian distributions
Next, we compare the local BPS to NUTS (“adapt=true,fit_metric=true,nuts=true”) as the dimension increases. Experiments are performed on the chain-shaped Gaussian Random Field of Section 4.2 with the pairwise precision parameter set to 0.5. We vary the length of the chain (10, 100, 1000), and run Stan’s implementation of NUTS for 1000 iterations + 1000 iterations of adaptation. We measure the wall-clock time (excluding the time taken to compile the Stan program) and then run our method for the same wall-clock time 40 times for each chain size. The absolute value of the relative error averaged on 10 equally spaced marginal variances is measured as a function of the percentage of the total computational budget used; see Figure 7. The gap between the two methods widens as increases. To visualize the different behavior of the two algorithms, three marginals of the Stan and BPS paths for are shown in Figure 8. Contrary to Section 4.1, BPS outperforms here HMC as its local version is able to exploit the sparsity of the random field.
5 Poisson-Gaussian Markov random field
6 Bayesian logistic regression for large data sets
Consider the logistic regression model introduced in Example 3 when the number of data is large. In this context, standard MCMC schemes such as the MH algorithm are computationally expensive as they require evaluating the likelihood associated to the observations at each iteration. This has motivated the development of techniques which only evaluate the likelihood of a subset of the data at each iteration. However, most of the methods currently available introduce either some non-vanishing asymptotic bias, e.g. the subsampling MH scheme proposed in , or provide consistent estimates converging at a slower rate than regular MCMC algorithms, e.g. the Stochastic Gradient Langevin Dynamics introduced in . The only available algorithm which only requires evaluating the likelihood of a subset of data at each iteration yet provides consistent estimates converging at the standard Monte Carlo rate is the Firefly algorithm .
In this context, we associate factors to the target posterior distribution: one for the prior and one for each data point with for all . As a uniform upper bound on the intensities of these local factors is available for restricted refreshment, see Appendix C.1, we could use (21) in conjunction with Algorithm 6 to provide an alternative to the Firefly algorithm which selects at each bounce a subset of data points uniformly at random without replacement. For , a related algorithm has been recently explored in . In presence of outliers, this strategy can be inefficient as the uniform upper bound becomes very large, resulting in a computationally expensive implementation. After a pre-computation step of complexity only executed once, we show here that Algorithm 6 can be implemented using data-dependent bounds mitigating the sensitivity to outliers while maintaining the computational cost of each bounce independent of . We first pre-compute the sum of covariates over the data points, , for and class label . Using these quantities, it is possible to compute
with given in (12). If is large, we can keep the sum in memory and add-and-subtract any local updates to it. The implementation of Step 5(c)ii relies on the alias method [8, Section 3.4]. A detailed description of these derivations and of the algorithm is presented in Appendix C.
We compare the local BPS with thinning to the MAP-tuned Firefly algorithm implementation provided by the authors. This version of Firefly outperforms experimentally significantly the standard MH in terms of ESS per-datum likelihood . The two algorithms are here compared in terms of this criterion, where the ESS is averaged over the components of . We generate covariates and data for according to (9) and set a zero-mean normal prior of covariance for . For the algorithm, we set and , which is the length of the time interval for which a constant upper bound for the rate associated with the prior is used, see Algorithm 7. Experimentally, local BPS always outperforms Firefly, by about an order of magnitude for large data sets. However, we also observe that both Firefly and local BPS have an ESS per datum likelihood evaluation decreasing in approximately so that the gains brought by these algorithms over a correctly scaled random walk MH algorithm do not appear to increase with . The rate for local BPS is slightly superior in the regime of up to data points, but then returns to the approximate rate. To improve this rate, one can adapt the control variate ideas introduced in for the MH algorithm to these schemes. This has been proposed in for a related algorithm and in for the local BPS.
7 Bayesian inference of evolutionary parameters
We compare against a state-of-the-art HMC sampler that uses Bayesian optimization to adapt the key parameters of HMC, the leap-frog stepsize and the number of leap-frog steps, while preserving convergence to the target distribution. Both our method and this HMC method are implemented in Java and share the same gradient computation code. Refer to the Supplementary Material for additional background and motivation behind this adaptation method.
We first perform various checks to ensure that both BPS and HMC chains are in close agreement given a sufficiently large number of iterations. After 20 millions HMC iterations, the credible intervals estimates from the HMC method are in close agreement with those obtained from BPS (result not shown) and both methods pass the Geweke diagnostic .
To compare the effectiveness of the two samplers, we look at the ESS per second of the model parameters. We show the maximum, median, and maximum over the 10 parameter components for 10 runs, for both BPS and HMC in Figure 11. We observe a speed-up by a factor two for all statistics considered (maximum, median, minimum). In the supplement, we show that the HMC chain displays much larger autocorrelations than the BPS chain.
Discussion
Most MCMC methods currently available, such as the MH and HMC algorithms, are discrete-time reversible processes. There is a wealth of theoretical results showing that non-reversible Markov processes mix faster and provide lower variance estimates of ergodic averages . However, most of the non-reversible processes studied in the literature are diffusions and cannot be simulated exactly. The BPS is an alternative continuous-time Markov process which, thanks to its piecewise deterministic paths, can be simulated exactly for many problems of interest in statistics.
As any MCMC method, the BPS can struggle in multimodal scenarios and when the target exhibits very strong correlations. However, for a range of applications including sparse factor graphs, large datasets and high-dimensional settings, we have observed empirically that BPS is on par or outperforms state-of-the art methods such as HMC and Firefly. The main practical limitation of the BPS compared to HMC is that its implementation is model-specific and requires more than knowing pointwise. An important open problem is therefore whether its implementation, and in particular the simulation of bouncing times, can be fully automated. However, the techniques described in Section 2.3 are already sufficient to handle many interesting models. There are also numerous potential methodological extensions of the method to study. In particular, it has been shown in how one can exploit the local geometric structure of the target to improve HMC and it would be interesting to investigate how this could be achieved for BPS. More generally, the BPS is a specific continuous-time piecewise deterministic Markov process . This class of processes deserves further exploration as it might provide a whole new class of efficient MCMC methods.
Acknowledgements
Alexandre Bouchard-Côté’s research is partially supported by a Discovery Grant from the National Science and Engineering Research Council. Arnaud Doucet’s research is partially supported by the Engineering and Physical Sciences Research Council (EPSRC), grants EP/K000276/1, EP/K009850/1 and by the Air Force Office of Scientific Research/Asian Office of Aerospace Research and Development, grant AFOSRA/AOARD-144042. Sebastian Vollmer’s research is partially supported by the EPSRC grants EP/K009850/1 and EP/N000188/1. We thank Markus Upmeier for helpful discussions of differential geometry as well as Nicholas Galbraith, Fan Wu, and Tingting Zhao for their comments.
References
Appendix A Proofs of Section 2
The BPS process is a specific piecewise-deterministic Markov process so the expression of its generator follows from [7, Theorem 26.14]. Its adjoint is given in and a derivation of this expression from first principles can be found in the Supplementary Material. To establish the invariance with respect to , we first show that . We have
As , the term (24) is trivially equal to zero, while a change-of-variables shows that
as and implies . Additionally, by integration by parts, we obtain as is bounded
Substituting (25) and (26) into (22)-(23)-(24), we obtain
where we have used and for any . The result now follows by [7, Proposition 34.7].
A.2 Proof of Theorem 1
We can now define our tractable set and establish its key properties.
Let , and assume the initial point of the BPS, satisfies , . If then the event
On the event , we have and for all ,
On the event , there are exactly two refreshments and no bouncing in the interval , i.e. , and ,
for , where denotes the truncated Gaussian distribution, with ,
.
To prove Part 1 and 2, we will make use of this preliminary result: on implies for . Indeed, and imply that for all . It follows that . Hence, by the continuity of and standard properties of the quantile function, .
Part 1 and 2: by the assumption on and and our preliminary result, , and hence, combining with and we have and . Also, by the triangle inequality, . We can therefore apply our preliminary result again and obtain , and hence, combining again with and , we have , , . Applying the triangle inequality a second time yields . We apply our preliminary result one last time to obtain . Hence, if , , while if , we can use to conclude that . It follows from the triangle inequality that for all .
Part 3, 4 and 5: these follow straightforwardly from the construction of . ∎
Note that the statement and proof of Part 4 is simple because . In contrast, conditioning on conceptually simpler events of the form leads to conditional distributions on which are harder to characterize.
In the following, denotes the -dimensional Euclidean ball of radius centered at .
For all such that , and , , , and , we have , where is defined by:
Using Lemma 1, Parts 4 and 5, we can rewrite the above conditional expectation as:
We will use the coarea formula to reorganize the order of integration, see e.g. Section 3.2 of . We start by introducing some notation.
For Riemannian manifolds and of dimension and , a differentiable map and a measurable test function, the coarea formula can be written as:
Here , and denote the volume measures associated with the Riemannian metric on , and (with the induced metric of ). In the above equations, is a generalization of the determinant of the Jacobian where is the corresponding Riemannian metric and is the representation of in local coordinates, see . Here JF\text{=\sqrt{\det DF\,DF^{\top}}} where is defined in equation (A.2) below.
We apply the coarea formula to , , F_{z}(\tau_{1},{{v}}_{1},\tau_{2},{\hyperlink{v}{\color[rgb]{0,0,0}{v}}}_{2})=\left(x+\tau_{1}v+\tau_{2}v_{1}+(t-\tau_{1}-\tau_{2})v_{2},v_{2}\right), , and obtain:
where denotes the joint conditional density of described in Part 5 of Lemma 1, and:
We define , and obtain the following inequality
It is therefore enough to show that . To do so, we will derive the following bounds related to the integral in :
Its domain of integration is guaranteed to contain a set of positive measure.
Its integrand is bounded below by a strictly positive constant.
To establish 1, we let , and notice that rearranging
yields an expression for given in (27). From Lemma 2, it follows that
and since the surface of the graph of a function is larger than the surface of the domain.
To establish 2, we start by analyzing . Exploiting its block structure, we obtain:
Moreover, it follows from basic properties of the truncated Gaussian distribution and of that
To prove Part 2 of the lemma, we divide the trajectory of length into three “phases” namely a deceleration, travel, and acceleration phases, or respective lengths defined below (see also Supplement for a figure illustrating the notation used in this part of the lemma). This allows us to use Part 1 of the present lemma which requires velocities bounded in norm by one. We require an acceleration phase since may not necessarily include velocities of norms bounded by one.
First, we show that we decelerate with positive probability by time . Let denote the event that there is exactly one refreshment in the interval , and that the refreshed velocity has norm bounded by one. Define also , which bounds the distance travelled in for outcomes in , since bouncing does not change the norm of the velocity. We have:
Next, to prepare applying the first part of the lemma, set
Informally, is selected so that the ball of radius around the origin contains both any position attained after deceleration, as well as ball around a point in . Indeed, since is open and that , there exists some such that and . Let also .
Of the total time , we reserve time to accelerate. This time is selected so that (a) , and (b), if we start with a position in , move with a velocity bounded in norm by for a time , we have that the final position is in . This holds since the distance travelled is bounded by . Hence, by a similar argument as used for deceleration, we have, for all ,
We can now exploit this Lemma to prove Theorem 1.
This contradicts that for .
The law of large numbers then follows by Birkhoff’s pointwise ergodic theorem; see e.g. [9, Theorem 2.30, Section 2.6.4]. ∎
Appendix B Proof of Proposition 2
The dynamics of the BPS can be lumped into a two-dimensional Markov process involving only the radius and for any dimensionality . The variable can be interpreted (via ) as the angle between the particle position and velocity . Because of the strong Markov property we can take without loss of generality and let be some time between the current event and the next, yielding:
If there is a bounce at time , then is not modified but .The bounce happens with intensity . These processes can also be written as an Stochastic Differential Equation (SDE) driven by a jump process whose intensity is coupled to its position. This is achieved by writing the deterministic dynamics given in (35) between events as the following Ordinary Differential Equation (ODE):
Taking the bounces into account turns this ODE into an SDE with
where is the counting process associated with a PP with intensity .
Now consider the push forward measure of under the map where is the uniform distribution on . This yields the collection of measures with densities . One can check that is invariant for (36) for all .
Appendix C Bayesian logistic regression for large datasets
We derive here a datapoint-specific upper bound to . First, we need to compute the gradient for one datapoint:
We then consider two sub-cases depending on or . Suppose first , and let
When implementing Algorithm 6, we need to bound . We have
The bound is constant between bounce events and only depends on the magnitude of . If we further assume that we use restricted refreshment then this bound is valid for any allowing us to implement Algorithm 6 using (20) or (21).
C.2 Sampling the thinned factor
We show here how to implement Step 5(c)ii of Algorithm 6 without enumerating over the datapoints. We begin by introducing some required pre-computed data structures. The pre-computation is executed only once at the beginning of the algorithm, so its running time, is considered negligible (the number of bouncing events is assumed to be greater than ). For each dimensionality and class label , consider the categorical distribution with the following probability mass function over the datapoints:
This is just the distribution over the datapoints that have the given label, weighted by the covariate . An alias sampling data-structure [8, Section 3.4] is computed for each and . This pre-computation takes total time . This allows subsequently to sample in time from the distributions .
We now show how this pre-computation is used to to implement Step 5(c)ii of Algorithm 6. We denote the probability mass function we want to sample from by
To sample this distribution efficiently, we construct an artificial joint distribution over both datapoints and covariate dimension indices
We denote by , respectively , the associated marginal, respectively conditional distribution. By construction, we have
It is therefore enough to sample and to return . To do so, we first sample (a) and then (b) sample .
so this sampling step again does not require looping over the datapoints thanks the pre-computations described earlier.
and therefore this sampling step can be computed in thanks to the pre-computed alias sampling data structure.
C.3 Algorithm description
Algorithm 7 contains a detailed implementation of the local BPS with thinning for the logistic regression example (Example 4.6).
Supplemental Material: The Bouncy Particle Sampler A Non-Reversible Rejection-Free Markov Chain Monte Carlo Method
Appendix D Illustration for Lemma 3
The following figure illustrates the different phases considered in the proof of Lemma 3.
Appendix E Direct proof of invariance
Let be the law of . In the following, we prove invariance by explicitly verifying that the time evolution of the density is zero if the initial distribution is given by in Proposition 1. This is achieved by deriving the forward Kolmogorov equation describing the evolution of the marginal density of the stochastic process. For simplicity, we start by presenting the invariance argument when .
It follows that the probability of having no bounce in the interval is given by:
and the density of the random variable is given by:
If a bounce occurs, then the algorithm follows a translation path for time , at which point the velocity is updated using a bounce operation , defined as:
The algorithm then continues recursively for time , in the following sense: a second bounce time is simulated by adding to a random increment with density . If , then the output of the algorithm is , otherwise an additional bounce is simulated, etc. More generally, given an initial point and a sequence of bounce times, the output of the algorithm at time is given by:
where denotes the empty list and the suffix of : . As for the bounce times, they are distributed as follows:
where
From this, we get the following decomposition:
Indeed, on the event that bounces occur, the random variable only depends on a finite dimensional random vector, , so we can write the expectation as an integral with respect to the density of these variables:
Marginal density. Let us fix some arbitrary time . We seek a convenient expression for the marginal density at time , , given an initial vector , where is the hypothesized stationary density on . To do so, we look at the expectation of an arbitrary non-negative measurable test function :
We used the following in the above derivation successively the law of total expectation, equation (S12), equation (S18), Tonelli’s theorem and the change of variables, , justified since for any fixed , is a bijection (being a composition of bijections). Now the absolute value of the determinant is one since is a composition of unit-Jacobian mappings and, by using Tonelli’s theorem again, we obtain that the expression above the brace is necessarily equal to since is arbitrary.
Derivative. Our goal is to show that for all
Since the process is time homogeneous, once we have computed the derivative, it is enough to show that it is equal to zero at . To do so, we decompose the computation according to the terms in Equation (S22):
The categories of terms in Equation (S23) to consider are:
No bounce: , , or,
Exactly one bounce: , for some , or,
Two or more bounces: , for some
In the following, we show that the derivative of the terms in the third category, , are all equal to zero, while the derivative of the first two categories cancel each other.
No bounce in the interval. From Equation (S14):
We now compute the derivative at zero of the above expression:
The first term in the above equation can be simplified as follows:
using Equation (S4). In summary, we have:
Exactly one bounce in the interval. From Equation (S16), the trajectory consists in a bounce at a time , occurring with density (expressed as before as a function of the final point ) , followed by no bounce in the interval , an event of probability:
where we used that . This yields:
To compute the derivative of the above equation at zero, we use again Leibniz’s rule:
Two or more bounces in the interval. For a number of bounce, we get:
and hence, using Leibniz’s rule on the integral over :
Putting all terms together. Putting everything together, we obtain:
where we used that , and for any function . Hence we have , establishing that that the bouncy particle sampler admits as invariant distribution. The invariance for then follows from Lemma 4 given below.
Suppose is a continuous time Markov kernel and is a discrete time Markov kernel which are both invariant with respect to Suppose we construct for a Markov process as follows: at the jump times of an independent PP with intensity we make a transition with and then continue according to , then is also -invariant.
Hence is -invariant. ∎
Appendix F Invariance of the local sampler
The generator of the local BPS is given by
The proof of invariance of the local BPS is very similar to the proof of Propostion 1. We have
where the term (S42) is straightforwardly equal to 0 while, by integration by parts, the term (S40) satisfies
as is bounded. Now a change-of-variables shows that for any
as and implies . So the term (S41) satisfies
where we have used and for any . Hence, summing (S43)-(S45)-(S42), we obtain and the result follows by [7, Proposition 34.7].
Appendix G Calculations in the isotropic normal case
As we do not use refreshment, it follows from the definition of the collision operator that
It follows that for if so, in this case, we have
Appendix H Supplementary information on the evolutionary parameters inference experiments
We consider an over-parameterized generalized time reversible rate matrix with corresponding to 4 unnormalized stationary parameters , and 6 unconstrained substitution parameters , which are indexed by sets of size 2, i.e. where . Off-diagonal entries of are obtained via , where
We assign independent standard Gaussian priors on the parameters We assume that a matrix of aligned nucleotides is provided, where rows are species and columns contains nucleotides believed to come from a shared ancestral nucleotide. Given and hence , the likelihood is a product of conditionally independent continuous time Markov chains over A, C, G, T, with “time” replaced by a branching process specified by the phylogenetic tree’s topology and branch lengths. The parameter is unidentifiable, and while this can be addressed by bounded or curved parameterizations, the over-parameterization provides an interesting challenge for sampling methods, which need to cope with the strong induced correlations.
H.2 Baseline
We compare the BPS against a state-of-the-art HMC sampler that uses Bayesian optimization to adapt the the leap-frog stepsize and trajectory length of HMC. This sampler was shown in to be comparable or better to other state-of-the-art HMC methods such as NUTS. It also has the advantage of having efficient implementations in several languages. We use the author’s Java implementation to compare to our Java implementation of the BPS. Both methods view the objective function as a black box (concretely, a Java interface supporting pointwise evaluation and gradient calculation). In all experiments, we initialize at the mode and use a burn-in of 100 iterations and no thinning. The HMC auto-tuner yielded and . For our method, we use the global sampler and the global refreshment scheme.
H.3 Additional experimental results
To ensure that BPS outperforming HMC does not come from a faulty auto-tuning of HMC parameters, we look at the ESS/s for the log-likelihood statistic when varying the stepsize . The results in Figure S3(right) show that the value selected by the auto-tuner is indeed reasonable, close to the value 0.02 found by brute force maximization. We repeat the experiments with and obtain the same conclusions. This shows that the problem is genuinely challenging for HMC.