A Discrete Bouncy Particle Sampler
Chris Sherlock, Alexandre H. Thiery
Introduction
Markov Chain Monte Carlo (MCMC) algorithms provide Monte Carlo approximations to expectations with respect to a given probability distribution, , via an ergodic Markov chain whose invariant distribution is . Non-reversible Markov Chaine Monte Carlo samplers, of which the Hamiltonian Monte Carlo algorithm (Duane et al. 1987) is perhaps one of the most successful and widely-used examples, are known to enjoy desirable mixing properties in several contexts. Indeed, several theoretical results quantify the advantages of non-reversible samplers. For example, Diaconis et al. 2000 obtains rates of convergence for a non-reversible version of the random walk algorithm; subsequently and inspired by Diaconis et al. 2000, Chen et al. 1999 describes the best acceleration achievable through the idea of lifting. On a different note, Hwang et al. 2015, Lelièvre et al. 2013, Rey-Bellet & Spiliopoulos 2015 and Duncan et al. 2016 investigate and quantify the advantages offered by leveraging (a discretization of) a non-reversible diffusion process for computing Monte-Carlo averages: in many settings, it can be proved that the standard reversible Langevin dynamics is the worst in terms of asymptotic variances among a large class of diffusion processes that are ergodic with respect to a given target distribution. More recently, different designs of non-reversible MCMC sampler have been proposed. The Zig-Zag sampler, an instance of the large class of Piecewise-Deterministic-Markov-Processes, first obtained as a scaling limit of a lifted Metropolis–Hastings Markov chain (Bierkens & Roberts 2017), is a continuous-time non-reversible Markov process that can be used for computing ergodic averages, and can be used for efficiently exploring Bayesian posterior distributions in the Big-Data regime (Bierkens et al. 2019). Inspired from the physics literature (Peters & de With 2012), the Bouncy Particle Sampler (Bouchard-Côté et al. 2017) is another continuous-time non-reversible Monte-Carlo sampler that demonstrates state-of-the-art performance when used to explore certain Bayesian posterior distributions. Fearnhead et al. 2018 reviews the Zig-Zag sampler and the Bouncy Particle Sampler and describes some extensions. The Bouncy Particle Sampler or the Zig-Zag Sampler requires more than simple point-wise evaluations of the log-target density and its gradient: one typically needs local upper bounds on derivatives of the log-target density. Unfortunately, those bounds are unavailable or difficult to compute in many applied situations. Consequently, such continuous-time samplers cannot be directly used in these settings. This article presents a discrete-time MCMC sampler, inspired by the Bouncy Particle Sampler, that can be implemented when only point-wise evaluations of the target-density and its gradient are available.
Our algorithm, the Discrete Bouncy Particle Sampler, is described in detail in Section 2.1. It extends the statespace from a position to a position and a direction in the same way that the Zig-Zag and Bouncy Particle samplers do; however, our algorithm operates in discrete time and is based upon the guided random walk of Gustafson 1998. The guided random walk combines two reversible kernels to create a non-reversible kernel which heads in a specific direction until a rejection occurs, at which point it reverses direction. Our key addition is a particular delayed-rejection proposal (Tierney & Mira 1999), used after any initial rejection, potentially avoiding many inefficient direction reversals. The delayed-rejection move is analogous to the bounce in the Bouncy Particle Sampler and we show that the Discrete Bouncy Particle Sampler can be viewed as a time discretization of the Bouncy Particle Sampler. An alternative discretization of the Bouncy Particle Sampler, based on the reflective slice sampler (Neal 2003) is described and extended in the independent work of Vanetti et al. 2017. Importantly, several interesting extensions have recently been proposed (Vanetti et al. 2017; Wu & Robert 2017; Wu & Robert 2020; Monmarché 2019; Michel et al. 2020) to scale and enhance this class of Piecewise-Deterministic-Markov-Processes MCMC samplers.
As with the Bouncy Particle Sampler, our algorithm can be reducible. To solve this issue, we perturb the direction vector at the end of every iteration. The size of this per-iteration perturbation has a substantial impact on the performance of the algorithm, in a similar way to the occasional, complete direction refresh of the Bouncy Particle Sampler (Bierkens et al. 2018). Analogously to the independent investigations for the Bouncy Particle Sampler in Bierkens et al. 2018, for the Discrete Bouncy Particle Sampler exploring a Gaussian target we use diffusion-approximation arguments to describe the limit of the radial process as dimension increases to infinity. We then leverage this to obtain the theoretical efficiency of the Discrete Bouncy Particle Sampler as a function of the partial-refreshment parameter, . This leads to a simple and robust tuning criterion that is described in Section 3.2. In more practical developments, we show that a surrogate may be substituted for the gradient of the target density when it is computationally expensive or impossible to obtain. Our final contribution is a construction that allows the user to choose to only calculate a fixed number of orthogonal components of the gradient vector.
The Discrete Bouncy Particle Sampler
The Discrete Bouncy Particle Sampler operates on the extended state space , where , and explores the extended target distribution
where is an auxiliary spherically symmetric distribution with support . Section 2.2 describes several standard choices of auxiliary distributions. Henceforth, we will refer to the variable as the position of a particle and the variable as its direction. The bounce after which the Discrete Bouncy Particle Sampler is named enters through the operator that reflects the vector with respect to the hyperplane orthogonal to the vector ,
For any vector , the reflection operator is an involution that preserves norms. This remark underlies the proof of correctness of the Discrete Bouncy particle Sampler whose details are presented in the Supplementary Material. As discussed in Michel et al. 2020, it is possible to rely on more general reflection operators. Most of the methods developed in this text extends to these variants, although we concentrate on Equation (1) for ease of exposition. The Discrete Bouncy Particle Sampler relies on a non-vanishing vector field
In practice, this vector field is either chosen as , replaced by an arbitrary modification when the gradient vanishes, or as an approximation of it, as described in Section 2.4. The quantity represents the resulting direction when a particle with incoming direction performs an elastic bounce off the hyperplane orthogonal to the vector .
The Discrete Bouncy Particle Sampler deterministically cycles through two Markovian transitions that leave the extended target distribution invariant, (1) a Position Update, with a possible Direction Reflection (2) a Direction Refreshment. The resulting scheme is, in general, non-reversible. For the direction refreshment, one can choose any Markov transition kernel that leaves the auxiliary distribution invariant. For a discretization parameter , and a current state , the algorithm proceeds as follows.
Position Update: Generate a proposal . With position update probability
set and go to Step 3. Otherwise, proceed to Step 2.
Direction Reflection: consider and . With direction reflection probability
set . Otherwise, negate the direction by setting .
Direction Refreshment: Set where .
By construction, the Direction Refreshment step preserves the extended target distribution. The fact that the combination of the Position Update and Direction Reflection steps also preserves the extended distribution is discussed in the Supplementary Material. This can be understood as a slight generalization of the standard delayed rejection mechanism (Tierney & Mira 1999) when applied to a deterministic and volume preserving proposal. A similar scheme was proposed independently in Vanetti et al. 2017. Furthermore, and importantly for Section 2.4, the algorithm remains valid if the deterministic vector field is replaced by a randomized version of it. The proof of correctness is identical to the deterministic case and is briefly discussed in the Supplementary Material.
A simple thought experiment, such as considering a target density with spherically-symmetric contours and , shows that, as with the Bouncy Particle Sampler, the Discrete Bouncy Particle Sampler can be reducible. The choice and tuning of the direction refreshment operator is consequently important in practice and is discussed at length in the sequel.
2 Direction dynamics
Full Refresh: for or and an update rate the Markov process with generator completely refreshes the direction at rate and has a mixing time of . For a time discretization parameter , set
where and is a Bernoulli random variable with .
Ornstein-Uhlenbeck refresh: for and an update rate , the Ornstein-Uhlenbeck process leaves invariant and has a mixing time of . Set
for and .
for and .
3 Continuous-time limit
for any integer and linearly interpolation in between. The main result of this section, Proposition 1, whose proof is presented in the Supplementary Material, relies on the following regularity assumptions.
The function is twice differentiable with a bounded second derivative.
The vector field is continuous.
There exists a continuous time Markov process with generator such that, for any time discretization parameter , the transition kernel describes the transition of the Markov process in the sense that . We assume that the trajectories of the Markov process are almost surely continuous.
Let Assumptions A(1-2-3) hold and consider a fixed time horizon . As , the sequence of continuous time processes converges weakly in the Skorokhod topology to the bivariate Markov process with generator
with rate and acceptance probability
The limiting Markov process with generator (6) evolves according to the dynamics
in between events that arrive at rate . When such an event is triggered, the direction is reflected, i.e. , with probability , and completely reversed, i.e. , with probability . Possible choices of Markovian dynamics with generator in Assumption A2 are detailed in Section 2.2. In the case when and , for a fixed refreshment rate , the limiting Markov process is the standard Bouncy Particle Sampler (Bouchard-Côté et al. 2017). The interested reader is referred to Vanetti et al. 2017; Wu & Robert 2017 for other interesting generalizations
In order to understand the influence of the vector field , it is instructive to study the limiting acceptance probability (7). The limiting process is rejection free, i.e. never backtracks, if for any we have that . It is readily seen that this condition is equivalent to choosing proportional to for any where this quantity does not vanish. In other words, any other choice of vector field leads to a limiting process that is not rejection-free. Section 2.4 describes ways to efficiently approximate this optimal choice when evaluating is not computationally efficient.
4 Approximate reflections
As described in the previous section, vector fields that lead to a rejection-free algorithm in the limit are such that is proportional to for all where this quantity is non-zero. When computing the gradient of the log-density is not computationally feasible, one can instead use a vector field that only approximates , necessarily paying the price of a non-zero probability for the limiting algorithm to backtrack. Another strategy, similar to the one presented in Fielding et al. 2011, consists in choosing as the gradient of an approximate surrogate target distribution.
One can also completely reflect the component of that is orthogonal to the plane . In other words, the updated direction is defined as
While both reflection operators are valid, we have empirically found that the operator (9) leads to better mixing properties.
5 Preconditioning
Algorithm tuning through diffusion approximation
Note that, in the definition of the process , time has been accelerated by a factor of . Proposition 2 stated below shows that, in order to observe a non-degenerate scaling limit as , this acceleration factor is the correct one. As will be demonstrated, the mixing properties of are closely related to the mixing properties of the scalar jump-diffusion with generator
The operator is the generator of an Ornstein-Uhlenbeck process that is reversible with the standard Gaussian density. Similarly, is the generator of the Markov process with unit drift and reflections that occur at rate . It can readily be checked that this process also leaves the standard Gaussian distribution invariant. Combining these two facts show that the process also leaves the standard Gaussian distribution invariant. We denote by the asymptotic variance of ergodic averages along defined as
There is no closed form expression for the quantity but it can easily be approximated numerically, as displayed in Figure 1. Note that as and . Proposition 2, whose proof can be found in the Supplementary Material, shows that the asymptotic variance dictates the mixing rate of the log-target process. The higher the asymptotic variance , the faster the mixing of the radial process.
The velocity function is defined in Equation (12).
The process (13) is an Ornstein-Uhlenbeck that is reversible with respect to the centred Gaussian distribution with variance . Since the Ornstein-Uhlenbeck (13) has a mixing time of order , this indicates that in the high-dimensional regime and , one can expect (Roberts & Rosenthal 2016) the log-target process to mix on a time scale of order . When implementing the Discrete Bouncy Particle Sampler in practice, the parameter should be chosen small enough to guarantee that the acceptance rate remains high-enough, but not smaller. Similar guidelines for the Hamiltonian Monte-Carlo method are described in Betancourt et al. 2014. The optimal tuning of the parameter , and study of its dependence with respect to the dimensionality of the target distribution, is beyond the scope of this article. Instead, we concentrate on the tuning of the refreshment parameter . When optimising the mixing of the log-target process, we observe empirically that the tuning of the parameter is insensitive to the value of . This is in part because whatever the value of , as long as it is sufficiently small, the log-target process is an approximation of the limiting diffusion (13) (see also Section 3.2); empirical evidence that this insensitivity continues to hold for large is provided in Section 4.1.
2 Tuning of the refreshment parameter κ\kappa
The limiting diffusion (13) obtained in Section 3.1 indicates that, for an isotropic Gaussian target distribution with marginal variance and in the regime , optimising the efficiency of the Discrete Bouncy Particle Sampler is achieved by choosing a refreshment parameter that maximizes the velocity . In other words, for a given marginal variance , the optimal refreshment rate is given by
Furthermore, a change of time argument immediately shows that with . In practice, the variance parameter is not known so that the optimal refreshment parameter is not directly accessible. To make progress, denote by the (strictly increasing) sequence of time indices at which Direction Reflection events are attempted (and always accepted in the Gaussian setting). We denote by the direction right before a reflection event, and by the direction right after the reflection. For tuning purposes, we propose to monitor the dot product between the direction vectors right after and before the Direction Reflection attempts,
For a Discrete Bouncy Particle Sampler evolving at stationarity, as and for any fixed dimension , consider the distribution of these dot products. One can readily check that if is Discrete Bouncy Particle Sampler chain with parameters exploring the centred -dimensional Gaussian with marginal standard deviation then, for any scaling factor , the Markov chain defined as is also Discrete Bouncy Particle Sampler chain, with refreshment parameter and time discretization parameter , exploring the centred -dimensional Gaussian with marginal standard deviation . It follows that for any scaling factor . Consequently, since , the distribution does not depend on the standard deviation . It is straightforward to numerically estimate the average dot product at optimality,
Figure 1 illustrates this optimality result. Very low values indicate that the directions are updated too frequently, leading to an inefficient random-walk behaviour. High values indicate that the directions are not updated frequently enough, leading to an inefficient exploration of the state space. The case corresponds to the case when the direction are not updated at all, which is known in the Gaussian case to lead to a reducible Markov Chain with an incorrect invariant distribution. For tuning the refreshment parameter of a general Discrete Bouncy Particle Sampler, we consequently propose to estimate empirically the expectation at stationarity of the quantity in (14). Let now denote the realization of the sequence of indices at which direction reflection attempts occur. A direction reflection attempt is accepted with probability (3), otherwise the direction is negated. We define
and choose so that this quantity approximately equals its optimal value . Just as with the estimation of acceptance rates when tuning the scaling of various algorithms (Roberts & Rosenthal 2001), and unlike the Effective Sample Size itself that is notoriously difficult to reliably estimate, the mean dot product can be estimated accurately from short MCMC runs. Importantly, and as described in Section 4, we have found this tuning procedure to be robust with respect to departure from Gaussianity and to approximately hold in non-isotropic and relatively low-dimensional settings with .
3 Non-isotropic target and non-zero δ\delta
The diffusion limit in Section 3.1 was obtained as and for an isotropic Gaussian target where the direction reflection proposals are always accepted. In this Section, we consider the non-isotropic case of a -dimensional target distribution defined as
where is the standard Gaussian cumulative function.
Simulation studies
2 Robustness of advice to departures from Gaussianity and isotropy
We next investigate the robustness of our tuning advice to departures of the target from Gaussianity and isotropy.
Consider three scenarios: an isotropic multivariate logistic distribution with density , an isotropic Gaussian distribution with density proportional to and a non-isotropic multivariate Gaussian distribution with density proportional to . In this section, we choose for both isotropic targets, and for the anisotropic target. In order to test the robustness of our tuning guidelines to non-isotropic distributions, we chose the scales linearly separated between and . The scaled effective sample size curves as a function of the mean dot-product are displayed in Figure 3. There is extremely good agreement with the theory developed in Section 4 for the isotropic distribution and the approximately isotropic distribution . Not surprisingly, mild departure from the theory is observed for strongly non-isotropic distributions such as . However, for dimension the departure, especially in terms of the optimal dot product, is barely noticeable. When and , however, our proposed guideline, i.e. tune the refreshment rate such that the mean dot-product , leads only to a loss of efficiency of approximately and respectively.
3 Convergence and tail behaviour
One of the most commonly used algorithms for inference in high-dimensional scenarios is Hamiltonian Monte Carlo Duane et al. 1987. However, it is well known (Livingstone et al. 2019) that due to the dependence of the Leapfrog step on , Hamiltonian Monte Carlo is not geometrically ergodic on targets with tails lighter than those of a Gaussian. By contrast, the Discrete Bouncy Particle Sampler depends on only through the equivalent normalized vector. The Supplementary Material details a simulation study on a non-isotropic, light-tailed target where a tuned Hamiltonian Monte Carlo algorithm is nearly more efficient than a tuned discrete bouncy particle sampler when started from stationarity. However, with the same tunings, but when started from a random point in the tail of the distribution, Hamiltonian Monte Carlo does not even move, whereas the discrete bouncy particle sampler quickly converges to the centre of the posterior mass.
4 The Markov modulated Poisson process
A simulation study on the eight-dimensional posterior of a non-trivial statistical model, the Markov modulated Poisson process, is detailed in the Supplementary Material. We find that mixing efficiency of is optimized at a dot product statistic of , tuning to would lead to only a reduction in efficiency. When either preconditioning or using only random components of the gradient vector, the optimal efficiency is achieved for a dot product statistics of .
Discussion
The key advantage of the Discrete Bouncy Particle Sampler over its continuous-time counterpart is that posterior and gradient evaluations can be treated as a “black box” with no requirement to bound the gradient so as to apply Poisson thinning. Unlike the continuous-time algorithm, there is a chance that an attempted bounce will be rejected and the particle will approximately backtrack, however for sensible tunings, the back-tracking probability converges towards zero as the dimension of the problem increases.
The average computational cost per iteration is insensitive to the choice of since the direction is updated every iteration, and has little effect on the number of steps between potential bounces. Thus it is sufficient for the purposes of this article to describe and empirically record efficiency in terms of effective sample size rather than effective samples per unit of time. The only exception to this is when we compare against Hamiltonian Monte Carlo in Appendix C.1.
The dot-product tuning diagnostic maps to an absolute scale via the properties of the posterior, just as the acceptance rate diagnostic does for the scaling in the random-walk Metropolis algorithm. When the velocity direction just before the next bounce is identical to that just after the previous bounce, and the dot product is unity. The mixing time of the refreshment process is ; when this is small compared with the time between bounces or, equivalently, the length scale of the target, the two velocity directions bear little relation to each other, and the dot product is small.
Whilst this article offers theory-based practical advice on the tuning of the refreshment parameter, , it does not tackle the choice of the discretization parameter, . In contrast to the insensitivity of computational cost to the choice of , increasing increases the frequency of potential bounces and hence of expensive gradient calculations, and this would need to be accounted for in any analysis.
Acknowledgements
Work by CS was supported by EPSRC grant EP/P033075/1. AHT acknowledges support from the Singapore Ministry of Education Tier 2 Grant (MOE2016-T2-2-135) and a Young Investigator Award Grant (NUSYIA FY16 P16; R-155-000-180-133).
References
Appendix A Correctness and proofs of propositions
The mapping is volume preserving.
The mapping preserves norms, .
Generate a proposal . With probability
set and go to Step 3. Otherwise, proceed to Step 2.
consider and . With probability
set . Otherwise, set .
Reverse the direction:
Consider any spherically symmetric probability density . Under Assumptions B1-2-3, the Markov kernel described by Step 1-2-3 leaves the density invariant.
with and and
Algebra shows that this is equivalent to proving that
Since and are involutions that preserve volume, a change of variable shows that the first integral in Equation (17) also equals its negation, and hence vanishes. And similarly, the change of variable shows that the second integral in Equation (17) also vanishes. This concludes the proof of the lemma. ∎
In Section 2.1, the combination of the Position Update and Direction Update is equivalent to Step 1-2-3 with the operator . Since algebra shows that the Conditions B1-2-3 are satisfied, Lemma 1 thus shows the correctness of the Discrete Bouncy Particle Sampler as described in Section 2.1.
A.2 Proof of Proposition 1
Recall that the quantity is defined as . Under Assumption (A1) and a discretization parameter , the acceptance probability that the proposal is accepted reads
where is a quantity whose absolute value is less than a constant times . For , the probability that the Discrete Bouncy Particle Sampler algorithm accepts consecutive proposals without reflection attenpts equals . Under Assumption (A3), one can condition upon a fixed trajectory of the Markov process , i.e. for all and , not depending on the parameter , so that . Equation (18), the continuity of the rate function as well as the continuity of the trajectories of the Markov process , show that
where . This means that, in the limit , bounce attempts arrive at rate and, in between the bounces, the limiting process simply evolves according to the dynamics (8).
Finally, once a proposal is rejected, the second proposal , i.e. the bounce, is accepted with probability described in Equation (3). By continuity of the density , we have that as . Furthermore, the Taylor expansion (18) gives that . Under Assumption, the vector field is continuous, which implies that
where we have dropped the dependence on from the notation and . It follows from (19) that, in the limit as , a proposed bounce is accepted with probability described in Equation (7), with as . This completes the proof of Proposition 1.
A.3 Proof of Proposition 2
where is the generator of the Brownian motion on the united sphere (5) and is the flip operator defined as . In order to obtain the limit of the process defined in Equation (10), set
Note that time has been accelerated by a factor . The process describes the dot product between the position and the direction , scaled by a factor in order to observe a non-degenerate limiting process. Itô’s lemma, neglecting terms of order , directly shows (after straightforward algebra) that the Markov process has a generator that reads
with the standard multiscale expansion notation , generators and defined in Equation (11) and
where is the Markov process with generator . Indeed, Equation (22) is the Kolmogorov backward equation associated to the Ornstein-Uhlenbeck
which concludes the proof of Proposition 2.
Appendix B High-dimensional behaviour for finite δ\delta and non-isotropic target
where . Hence as , the Central Limit Theorem gives
Also, by (24) and the central limit theorem,
where by the Lipschitz condition on , the boundedness of and because and . Further, the quantity also reads
Since and , the term to control in (26) is
in probability. If there is a delayed-rejection event then the standard move must have been rejected and, for example, must be negative. Let be the event that the standard move has been rejected and so a delayed-rejection step is being attempted. Let be the a priori density for at stationarity, and let be the density conditional on there being a delayed-rejection event. Then
which is well-behaved and has no mass where is undefined. In the limit as , is the density of the Gaussian distribution in (23), and (27) gives the limiting conditional density. It follows from the Bounded Convergence Theorem that
B.2 Simulation study varying dd for fixed δ\delta
Appendix C Further simulation studies
We reran Hamiltonian Monte Carlo for iterations additional times with for each , with a new, independent vector on each of the occasions. On each occasion we counted the fraction of times where, by iteration the algorithm had ever had a value with ; i.e., the algorithm had reached the main posterior mass. The number of runs which converged by this measure were: , , and ; indeed, for every run with the empirical acceptance rate was exactly zero. This fits with the known lack of geometric ergodicity of Hamiltonian Monte Carlo on light-tailed targets. By contrast, for the discrete bouncy particle sampler with , all runs converged within iterations, and, indeed, of the runs converged within iterations.
In summary, on this occasion, when both algorithms were started from the main posterior mass, the discrete bouncy particle sampler was competetive with Hamiltonian Monte Carlo, though less efficient. However, because our algorithm depends on only through the unit vector, it is robust to large , unlike Hamiltonian Monte Carlo.
C.2 The Markov modulated Poisson process
Finally, we consider a -state, continuous-time Markov chain started from state , and a Poisson process whose rate is a fixed function of . The doubly-stochastic process is parameterized by the rate matrix for the Markov chain, , and a vector of rates for the Poisson process, , where is the rate of when .
Code was written in C++ where auto-differentiation was not available for general matrix exponentials, and so numerical differentiation via centred differences was used (the cheaper, first-order Euler approximation led to precision problems). We applied the Discrete Bouncy Particle Sampler for iterations for a number of values and repeated this but evaluating only randomly-orientated components of the eight-dimensional gradient vector on each delayed-rejection step. Figure 5 plots scaled effective sample size against and suggests that the optimal mean dot product is around when all gradient components are used and around when three random components are used. The optimal effective sample size in the latter case is around of the former; since the number of gradient calculations during a bounce is also reduced by this suggests no loss in overall efficiency. When all components are used, tuning to a dot product of brings only a reduction in effective sample size. The posterior variance matrix has a condition number of , so, following typical practice, for each the Discrete Bouncy Particle Sampler was rerun using a crude preconditioning matrix (Section 2.5) of . Although the effective variance matrix still has a condition number of the right panel of Figure 5 shows that the optimal choice of is now .