Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 38 4 Solution Created 2026-10-03 Updated 2026-10-07
A Gibbs sampler updates one coordinate by drawing from its full conditional distribution, leaving the others unchanged and using their current values. Each coordinate kernel preserves the target joint law : integrate first over the unchanged coordinates, then over the old coordinate, and finally draw the new coordinate from the same conditional distribution. The resulting joint law is again . In the discrete notation, if two states share the remaining coordinates,which is symmetric in . Thus a coordinate update satisfies detailed balance. A systematic full sweep has kernel and remains invariant because each factor preserves . A fixed-probability random-scan mixture also preserves ; the mixture is reversible, whereas a systematic composition need not be.
In the autologistic binary-image model, count each neighboring pair once. Changing one pixel from zero to one raises by one and by the number of neighboring ones. The ratio of its two conditional weights is . ThereforeFor single-site Gibbs sampling, select a pixel, compute its current neighbor sum and replace it by a draw from a Bernoulli distribution with this probability. One may use random scans or complete ordered sweeps. The normalizing constant is not needed. For finite , every conditional probability lies strictly between zero and one; the finite chain is irreducible and has self-transitions, so its stationary law is unique and iterating converges to it.
For checkerboard Gibbs sampling, no edge joins two black pixels or two white pixels. Conditional on the whites, the black-pixel law factorizes:Draw all black pixels independently with these probabilities, then draw all white pixels independently conditional on the newly drawn blacks. Each color block is a full conditional update, so the two-block sweep preserves the joint target. Pixels of the same color can be updated together because their conditional distribution factorizes.
For the noisy image, the log likelihood contributes . Since , dropping terms independent of givesThe Gaussian-noise posterior for an autologistic image therefore has conditional probabilitiesUse this probability in both single-pixel and sequential color-block schemes. The independent observation factors change only the local field, so conditional independence within each color is retained. The same invariance proof then targets the posterior distribution rather than the prior.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 36 3 e Solution Created 2026-10-03 Updated 2026-10-06
Start from any . For independent draws from the standard normal distribution at each sweep, the Gibbs sampler can be implemented asThe second update must use the newly drawn first coordinate. The transform in part (a) supplies the needed independent Gaussian draws. Each conditional update preserves the joint posterior, so their composition does too.
Convergence is particularly transparent here. Centering at the posterior mean givesPositive definiteness gives , so this is a stable Gaussian autoregression. The full sampler has the desired posterior as its limiting invariant law. This is the linear contraction of a two-coordinate Gaussian Gibbs sweep.
For a posterior-integrable function , its posterior expectation is estimated after a burn-in byThe ergodic theorem justifies this Monte Carlo average. The retained values of also approximate its posterior distribution and quantiles. If a Bayesian point estimate is requested under squared-error loss, the posterior mean is the appropriate estimate, when its needed moments exist. An arbitrary function need not have a finite posterior mean; integrability must be assumed for the displayed target. Successive Gibbs draws are correlated, so uncertainty in the Monte Carlo average should use chain-aware error estimates rather than treating them as iid.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 4 d Solution Created 2026-10-03 Updated 2026-10-06
Use as the variance parameter, with prior density relative to . Let and . Multiplying the prior by the likelihood function gives the unnormalized Bayesian posteriorThe printed request for an “improper posterior” should not be read as a claim that this posterior is always improper. Although the prior is improper, integrating over gives a marginal kernel , which is integrable exactly when and . Under these usual nondegenerate-data conditions it is a proper posterior. If those conditions fail, the displayed kernel is improper and there is no posterior probability distribution for a sampler to target.
Completing the square and using the inverse-gamma distribution give the full conditionalsThe inverse-gamma distribution convention is density proportional to . Equivalently the precision satisfiesusing shape and rate, as in the question.
A Gibbs sampler starts from and alternatesThis is the normal mean-variance posterior with a log-uniform variance prior. For a marginal check, : integrating out reduces the shape by . This marginal shape is different from the full-conditional shape .
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 6 c Solution Created 2026-10-03 Updated 2026-10-06
For coordinate , keep the other coordinates fixed and propose from the full conditional . This is a Metropolis–Hastings algorithm proposal on that coordinate fibre, with deterministic equality . Its acceptance ratio isThus the coordinate update has acceptance probability one and is exactly a single-coordinate Gibbs sampler update.
A systematic sweep through coordinates is the composition of these kernels. Its joint transition density isThe already updated coordinates are new values, and the not-yet-updated coordinates are old values. Each coordinate kernel preserves , so their composition also preserves it. Systematic Gibbs sampling need not be reversible: each individual coordinate kernel is reversible, but their ordered composition need not be reversible; invariance is the property needed here. A random-scan mixture of the coordinate kernels is reversible.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 216 1 a Solution Created 2026-10-03 Updated 2026-10-06
Put and . Dropping factors independent of , the multinomial likelihood and uniform prior give the posterior densityMultiplying this by the stipulated binomial distribution for the latent variable cancels the factor :Consequently the two full conditional distributions areStart with , sample from its binomial distribution, then sample a new from its Beta distribution, and repeat. The binomial distribution can be sampled by adding independent Bernoulli random variables. For the Beta distribution, take independent and and return ; integer-shape gamma distributions are sums of independent unit-rate exponential distributions. Both shapes are positive even when some observed counts vanish.
Each Gibbs sampler update preserves the augmented posterior distribution, so its marginal distribution is the required posterior distribution. The positive full conditional distributions on the interior allow exploration of the entire support. These iterates are generally dependent; they are not the independent exact draws constructed in the later parts.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 216 3 b Solution Created 2026-10-03 Updated 2026-10-06
Take observation periods to have positive lengths , and let be the Markov kernel of a sweep which first draws given the current and then draws the new vector . Write . Conditional on , independence and the gamma distribution mean and variance giveAveraging over the full conditional distribution of preserves this bound, uniformly in the current state. Therefore . This is the mechanism in bounded conditional moments imply a geometric drift.
Choose , , and . Outside , ; inside , . HenceFor completeness, is a small set, even though it approaches the boundary of the positive orthant. Choose small enough that . On , . The conditional gamma distribution of has fixed shape and rate in a compact positive interval. Its probability density function therefore has a positive common lower bound on . For those , the product probability density function of similarly has a positive common lower bound on , since every shape is positive and every rate lies in a compact positive interval. Integrating over gives on , where is the uniform distribution on and .
The transition probability density function is positive throughout the positive orthant, giving an irreducible Markov chain. Since , the box minorization includes starts in the same box, which gives an aperiodic Markov chain. The proper prior distributions and bounded Poisson distribution likelihood have positive finite evidence, so the invariant posterior distribution is proper. Together with the geometric drift condition, these hypotheses imply geometric ergodicity. In particular, the argument proves the required drift rather than assuming that every Gibbs sampler is geometrically ergodic.
The positive-period convention matters. If zero lengths are allowed, the printed assertion can fail: take , , . Then and , soThis example has a proper posterior distribution but cannot satisfy a finite quadratic geometric drift condition. Thus the proof establishes the intended claim for positive observation periods, not an unrestricted extension to zero exposure.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 219 4 iii a Solution Created 2026-10-03 Updated 2026-10-05
Use the abbreviations in (i). Keeping only terms involving in the joint kernel and completing the square givesConsequently the Gaussian latent-colour update isThese updates are conditionally independent given the remaining variables. The flat mean prior gives one more normal full conditional:The factorization uses . Together these are the normal draws in the formal Gibbs sampler.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 219 4 iii b Solution Created 2026-10-03 Updated 2026-10-05
The terms involving giveCompleting the square produces the truncated normal distributionFor , its normalized density is on . The exponential prior shifts the untruncated conditional mean downwards before truncation; changing the variance here to the intrinsic variance would be incorrect. These are the other latent-variable updates of the formal Gibbs sampler.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 216 5 Solution 2026-10-03
Introduce , where means that the observation came from the structural-zero component. Conditional on the parameters,Given , the nonstructural observations are independent Poisson variables. Using shape-rate parameterization and the stated unit-rate priors, the remaining Gibbs updates areAlternating these four standard-distribution updates defines the requested Gibbs sampler for the Zero-inflated Poisson distribution posterior.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 219 4 d Solution 2026-10-03
Every move can be drawn from a full conditional distribution, producing a Gibbs sampler with acceptance probability one. Write and . First update independentlyand thenLet have rows and . Update the linear regression coefficients jointly byand updateFinally, the flat positive variance priors give the following full conditionals, each an inverse-gamma distribution:A systematic sweep in the displayed order, using the newly sampled values immediately, defines the chain. The shapes are positive for ; full column rank of is also required.