Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 1 h Solution Created 2026-10-03 Updated 2026-10-06
A uniform prior on makes the posterior density proportional to the Poisson change-point posterior likelihood above. The zeros trick introduces an observed zero with Poisson distribution mean , making its likelihood function equal to . Choose ; since , this mean is strictly positive. Rough BUGS code, with For , omit the array and set
zero=0 supplied as data, ismodel {
theta ~ dunif(0,T)
for (i in 1:n) {
before[i] <- step(theta-time[i])
}
j <- sum(before[])
logL <- theta-2*T+(n-j)*log(2)
zero ~ dpois(K-logL)
}j <- 0. Monitor the sampled theta to obtain its posterior mean, credible interval and interval probabilities.There is also an exact sampling method. On the posterior density is proportional to , so choose the interval with weightsThen draw from a uniform distribution on and set . These weighted interval draws sample the posterior directly, without asking a local Markov chain Monte Carlo update to cross its discontinuities.
Zeros trick 2026-10-06
A zeros trick implements a positive likelihood function by adding an observed zero with Poisson distribution mean . If this mean is nonnegative throughout the parameter support, its likelihood is and yields the intended Bayesian posterior. The constant must be independent of the parameter; arbitrary clipping changes the target.