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.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 4 c Solution Created 2026-10-03 Updated 2026-10-06
Use a proper normal distribution prior centered at zero on the log odds ratio. For example,puts approximately 95 percent of its mass between and , giving odds ratios roughly between and , close to and . Centering at zero treats reciprocal odds ratios symmetrically. If the desired central 95 percent interval is exactly , use standard deviation . A soft prior is appropriate for implausibility, whereas a bounded uniform prior would declare effects outside the limits impossible.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 4 e Solution Created 2026-10-03 Updated 2026-10-06
The overall mean and the between-study heterogeneity encode different information. A proper broad normal distribution prior such as is one possible weak prior for the mean log odds ratio; information about the spread of trials alone does not determine its center.
A concrete prior calibration for normal random-effect range can make the factor-of-50 statement simultaneous across all six trials. Conditional on , each pair difference has normal distribution . Set , , andFor every , each pair exceeds in absolute value with probability at most . The union bound therefore gives , and integrating over the uniform prior preserves that bound. This is one explicit interpretation of “very unlikely”; a different elicited probability would change the bound. A smoother proper scale prior could be calibrated similarly.
The proposed improper prior is unsuitable. The observed-data likelihood function approaches the positive common-effect likelihood as . After restricting and the intercepts to a compact interior region, it is bounded below there by a positive constant. HenceThis is an improper posterior from a log-uniform random-effect scale prior. Proper conditional sampling distributions do not repair the improper joint posterior, and an arbitrary tiny cutoff would make inference depend on that cutoff.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 4 f Solution Created 2026-10-03 Updated 2026-10-06
Represent the independent locally flat intercept prior distributions by broad finite uniform priors, for example on ; this is proper and approximately constant over plausible mortality logits. With calibrated above, rough BUGS code isUse and supply treated death counts with totals , and control death counts with totals . In BUGS, the second
model {
mu ~ dnorm(0,0.25)
tau ~ dunif(0,A)
invtau2 <- pow(tau,-2)
for (j in 1:J) {
alpha[j] ~ dunif(-10,10)
beta[j] ~ dnorm(mu,invtau2)
logit(thetaC[j]) <- alpha[j]-beta[j]/2
logit(thetaT[j]) <- alpha[j]+beta[j]/2
rC[j] ~ dbin(thetaC[j],nC[j])
rT[j] ~ dbin(thetaT[j],nT[j])
oddsRatio[j] <- exp(beta[j])
}
}dnorm argument is a precision parameter, so 0.25 corresponds to variance four. Initialize the positive scale away from zero. Monitor and study odds ratios, checking Markov chain Monte Carlo convergence diagnostics and sensitivity to the finite intercept bounds and scale prior distribution. The fitted hierarchy combines binomial sampling uncertainty with between-study heterogeneity. Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 2 25J i Solution Created 2026-09-24 Updated 2026-10-06
The uniform prior has , so the posterior is . Its mean and mode areThus the uniform-prior posterior mode is the maximum-likelihood estimator, including . The mean shrinks toward and equals the maximum-likelihood estimator only when .
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 ii Paper 1 28K a Solution Created 2026-09-24 Updated 2026-10-05
For observation , the likelihood is proportional to . For , its logarithmic derivative is , vanishing uniquely at ; the logarithm is strictly concave. At or , monotonicity gives the boundary maximum. Thus the maximum-likelihood estimator isA uniform prior multiplies this likelihood by a constant. The beta-integral normalization therefore gives the posterior distributionIn particular the posterior mean is not automatically the optimal estimator for the weighted loss in the next part.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 1 28K b iii Solution Created 2026-09-24 Updated 2026-10-05
For every estimator, its worst-case risk dominates its average risk under the uniform prior. Since the preceding Bayes estimator minimizes that average,The estimator has risk exactly throughout the interior, so it attains this lower bound. Under either endpoint convention discussed above its supremum over is also . ThusThis constant-risk Bayes argument works also for , when the only observed counts are endpoints and the posterior integrability argument still selects their corresponding decisions.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 1 28K b ii Solution Created 2026-09-24 Updated 2026-10-05
Condition on . For , the posterior expected loss is a strictly convex quadratic in the decision . Its minimizer isThe beta density gives and , so . If , every has infinite posterior expected loss because of the nonintegrable term near zero, whereas has finite loss expectation. The analogous argument at forces . Hence the Bayes estimator isIndeed is unbiased and has variance , which cancels the loss denominator. Its uniform-prior Bayes risk is .
The printed loss is undefined at , despite the stated closed parameter interval. A convention is necessary there. The natural extended loss assigns zero to the correct endpoint decision and infinity to an incorrect one; it gives endpoint risks zero for . Alternatively a continuous extension of this estimator's risk gives endpoint values . The interior result and the minimax value below are unchanged by either convention, and a uniform prior gives the endpoints measure zero. We do not identify an undefined with a value without specifying this choice.
Poisson change-point posterior 2026-10-06
For an Inhomogeneous Poisson process whose known positive intensity changes from to at an unknown time , the ordered arrival-time likelihood function isUnder a uniform prior, each interval between successive arrivals has an exponential posterior density with rate in the exponent . Its integrated weights allow exact interval selection followed by a truncated exponential draw; when the two rates coincide, the Bayesian posterior is uniform and the data contain no change-time information.
Uniform prior Created 2026-10-05 Updated 2026-10-06
A uniform prior on a finite-volume parameter region assigns constant probability density there and zero outside. On it is , giving a Beta distribution posterior after binomial distribution data. Uniformity depends on the coordinate: a nonlinear reparametrization introduces a Jacobian and generally does not preserve a uniform density.