Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 1 f Solution Created 2026-10-03 Updated 2026-10-06
There is a notation problem here. The posterior predictive probability calculated above is already a fixed number conditional on . Literally,No simulation is needed for that interpretation. The known exposure is also necessary, despite its omission from this part's list of inputs.
The natural uncertain quantity is instead . For its posterior probability of being below one half, draw the rate from its gamma distribution Bayesian posterior and average an indicator. Rough BUGS code isThe monitored average of
model {
lambda ~ dgamma(a+n, b+T)
q <- exp(-lambda)
belowHalf <- step(lambda-log(2))
}belowHalf estimates , equivalently . The equality boundary has zero probability. This code samples the already updated Bayesian posterior; adding the count likelihood function again would count the data twice. Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 1 g Solution Created 2026-10-03 Updated 2026-10-06
For an Inhomogeneous Poisson process, the likelihood function is the product of the intensities at arrivals times the exponential of minus the integrated intensity. The integrated intensity is . There are arrivals at rate one and at rate two, soSet and to include changes before the first or after the last arrival. An arrival exactly at the change has probability zero, so the convention for at that point does not affect the Bayesian posterior.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 2 c Solution Created 2026-10-03 Updated 2026-10-06
Independent Jeffreys priors and the two independent binomial distribution likelihood factors give, by Beta-binomial conjugacy,The Bayesian posteriors remain independent because each observation factor involves only its own probability. Their posterior means are respectively and . Notice that is the probability of saying milk first when tea was first, rather than the probability of a correct tea identification.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 2 d Solution Created 2026-10-03 Updated 2026-10-06
In Markov chain Monte Carlo, retain the derived quantity at every iteration. Rough BUGS code using the actual observations isSupply
model {
pM ~ dbeta(0.5,0.5)
pT ~ dbeta(0.5,0.5)
milkAnswers ~ dbin(pM,4)
teaAnswers ~ dbin(pT,4)
delta <- pM-pT
positive <- step(delta)
}milkAnswers=3 and teaAnswers=1. Summarize delta by its posterior mean, empirical quantiles and credible interval; the average of positive estimates . Here . Check Markov chain Monte Carlo convergence diagnostics before interpreting the simulation. Since both Bayesian posteriors are independent known Beta distributions, direct independent sampling is an equally valid, simpler way to obtain the same summaries. Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 3 i Solution Created 2026-10-03 Updated 2026-10-06
In a normal linear model, attach a continuous spike-and-slab prior to each regression coefficient. With suitably scaled predictors, introduce indicators and setThe narrow component describes practically negligible effects; the wide component permits substantial ones. Fit the joint Bayesian posterior of coefficients, indicators and any unknown residual variance. Bayesian model averaging gives shrinkage toward zero for poorly supported effects, while quantifies wide-component support. A shared Beta distribution prior on can represent uncertainty about how many effects are substantial.
Select on scientifically meaningful effect size, for example a high for a prechosen threshold in meaningful predictor units. Membership in the wide component alone does not imply a large realized effect: its normal distribution still permits values near zero. Correlated predictors also require interpretation of the joint Bayesian posterior, rather than treating each coefficient as an isolated test.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 35 1 d Solution Created 2026-10-03 Updated 2026-10-06
Multiple imputation by chained equations specifies one conditional distribution for each incomplete variable. In general, let be the incomplete variables, the fully observed predictors, and the parameters of a model . The notation means all variables except . The models should respect each variable's support and contain the terms needed by the planned analysis.
First choose suitable models and initialise only the missing entries with admissible provisional values. One sweep updates in turn. At update , fit its model to records whose is observed, using the latest filled-in predictors. DrawThe first draw represents parameter uncertainty through a Bayesian posterior; the second represents residual uncertainty through a posterior predictive distribution. Replace the missing entries with these draws, leaving every genuinely observed entry fixed. Repeat whole sweeps until the chain has settled, assessing traces, mixing and plausibility. Obtain completed datasets from independently initialised chains, or sufficiently separated draws after convergence. Both parameter and missing-value uncertainty must be propagated; repeated deterministic prediction is not multiple imputation.
Here use a logistic regression for conditional on , age and sex. For , use an appropriate discrete count model conditional on , age and sex, such as a suitably checked negative binomial regression, allowing enough flexibility for skewness and nonlinear effects. Include interactions or transformations needed by the analysis in the imputation models. If condom use is structurally undefined for a record, preserve that applicability rule rather than treating it as ordinary missing data.
Impute the eligible survey information before discarding records solely because the observed is absent. In each completed dataset select its own records and fit the requested logistic regression. This allows a record with missing to contribute to the target group in some imputations and not others. Models must respect any known eligibility restrictions; if eligibility was independently known, use that information.
For a scalar regression coefficient, let be its estimate and its estimated variance in completed dataset . Rubin's rules giveThe standard error is . Use the corresponding multiple-imputation confidence interval, rather than treating one completed dataset as fully observed. For vector coefficients replace the squared differences by outer products and by the covariance matrix. This combines within-imputation and between-imputation uncertainty.
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 2022 iii Paper 218 6 a Solution 2026-09-28
The prior isThe software samples from the Bayesian posterior; the displayed "Estimate" values are posterior means computed from the Markov-chain Monte Carlo draws.
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 4 28L c Solution Created 2026-09-24 Updated 2026-09-25
Sincethe first full conditional isHolding fixed and comparing powers and exponential rates givesThe assumed parity of makes a positive integer.
Initialize arbitrarily. At iteration , putDraw independent uniform variables and setBy sampling an integer-shape gamma distribution, this has the required law. Next draw independently and setThese are exactly the two full-conditional updates of the normal mean-precision Gibbs sampler. After discarding burn-in, the pairs are approximate samples from the posterior by Markov chain Monte Carlo.
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.
Poisson-uniform posterior mean 2026-10-07
For a uniform prior distribution on with , conditionally independent Poisson distribution observations have sufficient count . Their Bayesian posterior density is proportional to on that bounded interval. The displayed posterior mean is the Bayes estimator under squared error loss, and is generally not the affine Bühlmann credibility estimate.
Posterior predictive distribution 2026-10-06
The distribution of a new or missing quantity integrates its model over the Bayesian posterior: . Both parameter and residual uncertainty should enter predictive draws used for multiple imputation.
Posterior predictive probability 2026-10-05
A posterior predictive probability averages a future-event probability over the Bayesian posterior. For a Bernoulli distribution with unknown parameter , it is . Under Beta-binomial conjugacy with posterior , the predictive success probability is .
Posterior variance 2026-10-06
A posterior variance is the variance of a parameter under its Bayesian posterior, namely when finite. It describes remaining uncertainty after observing data and is distinct from the repeated-sampling variance of a fitted estimator.
Prior density 2026-10-07
A prior density is the probability density function of a continuous prior distribution with respect to a specified reference measure. A proper prior density is nonnegative and integrates to one. Prior-density factors enter Bayesian posterior and RJ-MCMC acceptance formulas along with the likelihood and model prior probabilities.
Single-observation location minimax bound Created 2026-10-06 Updated 2026-10-07
For a known mean-zero noise law with finite variance , observing only with unrestricted has minimax risk under squared-error loss. The observation itself attains this risk. For the lower bound, use a flat prior distribution on and condition an easier experiment on . Away from the prior endpoints, the Bayesian posterior noise has its original truncated law. Let and then in the resulting Bayes risk lower bound. No normal distribution or density for the noise is required.
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.