Archive for Metropolis-within-Gibbs algorithm

scalability of Metropolis-within-Gibbs schemes

Posted in Books, Statistics, University life with tags , , , , , , on July 17, 2024 by xi'an

My friends Filipo Ascolani, Gareth Roberts, and Giacomo Zanella recently arXived a paper on the scalability (in the dimension) of Gibbs and Metropolis-within-Gibbs sampling schemes. Which is celebrating a sort of return of the Gibbs sampler as a dimension resistant device (when compared with other solutions), witness the following extract:

“….we provide bounds on the approximate conductance of a generic coordinate-wise scheme in terms of the corresponding quantity for the Gibbs sampler. Working with the approximate version of the conductance is crucial for our purposes and subsequent applications. The general theory naturally applies to Metropolis-within-Gibbs schemes, such as those targeting conditionally log-concave distributions. In the second part, we analyze performances of coordinate-wise samplers for relevant statistical applications, combining the bounds discussed above with specific model properties, statistical asymptotics and some novel auxiliary results on approximate conductances and perturbation of Markov operators. Much emphasis is placed on coordinate-wise schemes for generic two-levels hierarchical models with non-conjugate likelihood for which we are able to prove dimension-free behaviour of total variation mixing times, under warm and feasible starts.” F. Ascolani, G.O. Roberts, and G. Zanella

Here, M -warm starts meaning a starting measure bounded by the target, i.e., not too far in the tails, while conductance Φ is a measure related with the probability that the Markov chain exits an arbitrary set A in one step, given that it starts from the target π restricted to A. The paper quantifies the loss of efficiency incurred by substituting an exact Gibbs update with a π¹-invariant one, e.g. M-within-G, that is

\Phi_s(P)\ge\min_i\kappa(P_i, X)\Phi_s(G)

following from

G_i(\partial A)\ge P_i(\partial A)\ge \kappa_i(P_i, X)G_i(\partial A)

In the (rather unrealistic) case of an independent Metropolis-within-Gibbs proposal enjoying an upper bound M on the Radon-Nykodym derivative between target and kernel, the conductance of Metropolis-within-Gibbs is at least one M-th of the conductance of Gibbs, ie a constant slowdown relative to exact Gibbs if the dimensionality is fixed but arbitrary.

The paper further studies a hierarchical Bayes model when the number J of groups goes to infinity and only top (of the hierarchy) parameter is of interest. In that setting, only two requirements need be satisfied for the Metropolis-within-Gibbs kernel P to mix fast: namely that the Gibbs kernel G mixes fast and  that the conditional conductance of P around true ψ is good enough. A further point of relevance is the demonstrated O(J) computational cost, ie the Metropolis-within-Gibbs algorithm with kernel P produces a sample with ϵ-accuracy in TV distance with O(J) cost when initialized from a warm start, a better magnitude than alternatives like the Metropolis-Adjusted Langevin (MALA) and the Hamiltonian Monte Carlo (HMC) algorithms. When checking for connections with other papers, I came across the nearly completed book by Sinho Chewi on long-concave sampling, which seems to be exploring similar ground.

 

turn-key and scalable synchronous distributed MCMC algorithm

Posted in Statistics, University life with tags , , , , , on April 29, 2022 by xi'an

Last week, I attended a Lagrange seminar where Vincent Plassier presented a ICML²¹ paper he had co-authored with Maxime Vono, Alain Durmus, and Eric Moulines. Aiming at distributed MCMC algorithms that operate on several machines, with a target distribution that breaks as a target

\int\prod_{i=1}^b \pi_i(\theta,z_i)\,\text d\mathbf{z}=\prod_{i=1}^b e^{U_i(A_i\theta)}

where θ is common to all terms. And each term in the product can (only) be computed locally. This setup is obviously the same as for the embarrassingly parallel approaches of Neiswanger et al. (2014) and Scott et al. (2016). And it follows an earlier proposal of Vono et al. (2020), which appears as a full Gibbs algorithm on the augmented parameters (θ,z), assuming each term is a conditional density in the latent z’s. Which requires constant communications between the b workers and the central “master” node when θ is concerned. The ICML²¹ paper overcomes this difficulty by defining an approximate target with a Normal component in z. Meaning that the (approximate) conditional distribution of θ given the latent z is Normal, i.e. considering the augmented joint

\prod_{i=1}^b\exp\left\{u_i(z_i)-\rho_i||z_i-A_i\theta||^2\right\}

but despite the Gaussian aspect, this is not always practical:

“When d [is large], this Gibbs sampling scheme unfortunately leads to prohibitive computational costs and hence prevents its practical use for general Bayesian inference problems.”

The authors then move to simulating from several Langevin step, more specifically running one move of the Euler-Maruyama discretisation scheme of the overdamped Langevin stochastic differential equation. Communication with the central node is then reduced. The paper proposes a proof of convergence in this unusual (since overdamped) setup. As well as bounds on the bias due to the inclusion of the latent variables. They also manage to find the required scaling of the various parameters involved (Normal variance, discretisation scale, Langevin runs) to achieve convergence, which I find rather remarkable. The table at the top illustrates the comparison with earlier methods, whenever available.

ensemble Metropolis-Hastings

Posted in Books, Kids, Statistics with tags , , , , , on October 14, 2021 by xi'an

A question on X validated about ensemble MCMC samplers had me try twice to justify the Metropolis-Hasting ratio the authors used. To recap, ensemble sampling moves a cloud of points (just like our bouncy particle sampler) one point X at a time by using another point Z as a pivot or origin and moving randomly X along the line [XZ]. In the paper,  the distribution of the rescaling is symmetric in the sense that f(z)=f(1/z). I indeed started by perceiving the basic step of the sampler as a Metropolis-within-Gibbs step along a random direction. But it did not work as the direction depends on the current X. I then wondered at a possible importance sampling interpretation compensating for the change of scale, but it was leading to the wrong power anyway. Before hitting the fact that this was actually a change of radius in the space with origin Z, leaving the angular coordinates invariant. Which explained for the power (n-1) in the Metropolis ratio, in agreement with a switch to polar coordinates.

Bayesian GANs [#2]

Posted in Books, pictures, R, Statistics with tags , , , , , , , , , , , , on June 27, 2018 by xi'an

As an illustration of the lack of convergence of the Gibbs sampler applied to the two “conditionals” defined in the Bayesian GANs paper discussed yesterday, I took the simplest possible example of a Normal mean generative model (one parameter) with a logistic discriminator (one parameter) and implemented the scheme (during an ISBA 2018 session). With flat priors on both parameters. And a Normal random walk as Metropolis-Hastings proposal. As expected, since there is no stationary distribution associated with the Markov chain, simulated chains do not exhibit a stationary pattern,

And they eventually reach an overflow error or a trapping state as the log-likelihood gets approximately to zero (red curve).

Too bad I missed the talk by Shakir Mohammed yesterday, being stuck on the Edinburgh by-pass at rush hour!, as I would have loved to hear his views about this rather essential issue…

amazing appendix

Posted in Books, Statistics, Travel, University life with tags , , , , , , , , , , , on February 13, 2018 by xi'an

In the first appendix of the 1995 Statistical Science paper of Besag, Green, Higdon and Mengersen, on MCMC, “Bayesian Computation and Stochastic Systems”, stands a fairly neat result I was not aware of (and which Arnaud Doucet, with his unrivalled knowledge of the literature!, pointed out to me in Oxford, avoiding me the tedium to try to prove it afresco!). I remember well reading a version of the paper in Fort Collins, Colorado, in 1993 (I think!) but nothing about this result.

It goes as follows: when running a Metropolis-within-Gibbs sampler for component x¹ of a collection of variates x¹,x²,…, thus aiming at simulating from the full conditional of x¹ given x⁻¹ by making a proposal q(x|x¹,x⁻¹), it is perfectly acceptable to use a proposal that depends on a parameter α (no surprise so far!) and to generate this parameter α anew at each iteration (still unsurprising as α can be taken as an auxiliary variable) and to have the distribution of this parameter α depending on the other variates x²,…, i.e., x⁻¹. This is the surprising part, as adding α as an auxiliary variable was messing up the update of x⁻¹. But the proof as found in the 1995 paper [page 35] does not require to consider α as such as it establishes global balance directly. (Or maybe still detailed balance when writing the whole Gibbs sampler as a cycle of Metropolis steps.) Terrific! And a whiff mysterious..!