Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 219 3 e Solution 2026-09-28
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 219 3 c Solution 2026-09-28
A Gibbs sampler draws each variable from its full conditional distribution, so every proposed update is accepted. At the start of a sweep define , , andFirst update the reddenings independently asRecompute and , then make the Gaussian updatesandWiththe remaining full conditionals, in the parameterization given in the question, are the scaled inverse chi-squared lawsRepeating these updates in the displayed order gives a complete Gibbs sweep. The formulas assume and nondegenerate sampled predictors; posterior propriety must be checked because the hyperpriors are improper.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 216 1 e Solution 2026-09-28
Put . The Weighted graph Laplacian of the tree is defined byMultiplication of the Gaussian likelihood by the prior shows that, conditionally on the precision parameter ,Completing the square therefore givesAs a function of , the posterior density isso, in shape-rate notation,The precision matrix has the sparsity pattern of a tree. A sparse Cholesky decomposition and its triangular solves have cost and storage on this graph, while the gamma update also costs . Hence each systematic-scan Gibbs sampler iteration costs .
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 207 3 c iii Solution Created 2026-09-24 Updated 2026-09-25
Bayes theorem turns the categorical distribution prior probabilities and the component multivariate normal densities intoThese probabilities define the label update in the Gibbs sampler.
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 4 28L b Solution Created 2026-09-24 Updated 2026-09-25
Choose an initial value . One sweep of the Gibbs sampler consists ofAfter a burn-in period, the pairs are retained as approximate samples. Standard irreducibility and recurrence conditions are needed for convergence from the chosen starting point.