Past exam of the mathematics course of the University of Cambridge 2014 ia Paper 2 12F Solution Created 2026-09-24 Updated 2026-10-06
An exponential distribution of rate has density for and zero for , with survival probability . For , its memoryless property follows fromFor the minimum, independence gives . HenceThe density is zero for negative . The comparison probability follows from identical continuous laws and zero tie probability; directly it is . These are competing exponential clocks.
For the last density, substitute into the normalizing integral to obtain , the Gaussian integral. Equivalently, each variable has a gamma distribution with shape and rate one. Independence permits convolution of the densities. For ,Putting turns the integral into . ConsequentlyThis is also the additivity of independent gamma distributions with a common rate: their shapes add to one. Density values at the single endpoint zero are immaterial.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 31 4 a Solution Created 2026-10-03 Updated 2026-10-06
Use the gamma distribution shape-rate convention: with . The conditional Poisson distribution has mean and variance both equal to , so the Bühlmann–Straub model parameters areFor and , the Bühlmann–Straub credibility factor is . Thusand the required expected-count estimate isThe total exposure determines how much information the observed count carries; the number of years alone is not the appropriate denominator.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 31 4 b Solution Created 2026-10-03 Updated 2026-10-06
Conditional on , summing the individual independent Poisson counts gives . The between-year conditional independence makes the likelihood functionMultiplying by the gamma distribution prior density, proportional to , gives the Poisson-gamma conjugacy with unequal exposures:For an action , the posterior squared-error loss decomposes asHence the Bayes estimator under squared error loss is the posterior mean, givingFuture counts are independent of the observed years conditional on , so the law of total expectation then gives the posterior predictive expected countThe Bayesian and credibility estimates coincide exactly. This exact Bühlmann–Straub credibility for Poisson-gamma counts occurs because the posterior mean is already affine in the exposure-weighted experience, and therefore belongs to the class over which the credibility estimate minimizes mean squared error.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 3 c Solution Created 2026-10-03 Updated 2026-10-06
Both fits use the same Gamma distribution mean model and inverse link function. Their coefficient estimates, fitted means and hence their weight matrices coincide: the common dispersion parameter only multiplies the likelihood score by a scalar and therefore does not change its zero. The displayed calls likewise show the same family and formula; fixing dispersion in a summary changes the uncertainty calculation, not these coefficient estimates.
For and , the Fisher information weights areThus the common matrix is multiplied by dispersion in the exponential case and by in the fitted gamma case. Taking square roots of the diagonal covariances givesFor instance for the intercept, and the same factor applies to all the coefficients. The standard errors are smaller because the fitted dispersion parameter is below one, not because a different mean function was fitted.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 1 b Solution Created 2026-10-03 Updated 2026-10-06
A conjugate prior is a family of prior distributions whose members remain in that family after updating by the likelihood function. Here multiplying a shape-rate gamma distribution density by the Poisson process likelihood changes its power of and its exponential rate, leaving a gamma distribution. The parameters change with the observations; conjugate prior does not mean that the Bayesian posterior equals the prior distribution.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 1 e Solution Created 2026-10-03 Updated 2026-10-06
The posterior predictive probability averages the conditional probability over the Bayesian posterior. Using its gamma distribution density,For fixed and ,Consequently , and both tend to . This is reasonable because the posterior mean tends to the observed rate and the posterior variance tends to zero. Averaging then approaches evaluating it at the estimated rate: with abundant observations, predictive uncertainty about the rate vanishes.
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 2015 iii Paper 34 1 b Solution Created 2026-10-03 Updated 2026-10-06
To distinguish the random intensity from its possible values, write it as . Its law is a gamma distribution with shape and rate . HenceFor the Poisson mixture, conditional expectation and conditional variance both equal . The law of total expectation and the law of total variance yieldwhere . Applying the random sum of independent claims formulas with the exponential distribution of the claim sizes gives the portfolio B momentsAt the matched intensity , the expected value for portfolio A is also , whereas its variance is . Thus the expected totals agree, but mixing increases the variance:The extra term is precisely .
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 34 4 Solution Created 2026-10-03 Updated 2026-10-06
In the Bühlmann model, a latent risk parameter is drawn from a population distribution. Conditional on , the yearly observations are independent and identically distributed random variables, with conditional expectation and conditional variance . Define the structural parametersHere is the expected process variance, while is the variance of hypothetical means. The Bühlmann credibility premium is the best affine estimate of from the observed claims, under mean squared error. Predicting the next claim gives the same affine estimate: the extra conditional observation noise contributes the constant to the prediction error.
The law of total variance and conditional independence giveAn affine estimate can be written as : for any chosen , optimizing the constant makes its expected value equal to . The normal equations for the linear least-squares projection areFor they force all to agree, with . Thus the credibility factor and premium areThe credibility factor increases with the observation count and between-risk variance, and decreases with within-risk variance. If , the risk mean is known and ; if and , one observation reveals it and . If both vanish, the premium is the fixed value and the factor is immaterial.
In the specified model, the conditional law is a gamma distribution with shape and scale . ThereforeThe prior is an inverse-gamma distribution with shape and scale . To obtain its moments directly, substitute in the defining integral, obtainingThe Gamma function recurrence yieldsThe assumption makes both structural variances finite. HenceIt follows that the model-specific credibility estimate is
For the Bayes estimator under squared error loss, the quantity to estimate is , so the optimum is its posterior mean. The likelihood function, viewed as a function of , is proportional toMultiplication by the prior shows gamma scale inverse-gamma conjugacy:Although the printed hint only mentions integer shapes, the same substitution and Gamma integral normalize this posterior for every positive real shape, so no integrality of is needed. Its posterior mean gives the Bayesian estimate and comparisonThis exact Bühlmann credibility for gamma claims holds for every observed sample, not merely on average. Here the posterior mean is affine in the sample mean, so the best affine Bühlmann credibility premium is also the unrestricted Bayes estimator under squared error loss.
Past exam of the mathematics course of the University of Cambridge 2016 ia Paper 2 9F Solution Created 2026-09-24 Updated 2026-10-06
Set and . Their inverse change of variables is , , with domain , . The absolute Jacobian determinant of this inverse transformation isUse the independence of random variables to multiply the two original Gamma distribution densities. The change of variables formula then gives the joint probability densityFactor this into two normalized densities:The support is a product domain, and the factors are precisely a Beta distribution density and a Gamma distribution density. ThereforeThis beta-gamma independence uses the common rate ; it is a rate parameter, not the scale parameter .
Past exam of the mathematics course of the University of Cambridge 2016 ib Paper 1 7H Solution Created 2026-09-24 Updated 2026-10-06
Let . The likelihood ratio of rate two to rate one is , which decreases strictly with . By the Neyman-Pearson lemma, the most powerful test rejects for small values of the sum:Under the null, has the gamma distribution with shape and rate one. Thus is its -quantile, equivalently half the -quantile of the chi-squared distribution with degrees of freedom. The distribution is continuous, so boundary randomization is unnecessary for .
For every fixed alternative , the likelihood ratio against rate one is , again strictly decreasing. Therefore the same region is most powerful against every such alternative. Moreover, if has the shape-, rate-one gamma distribution, then at rate has the same distribution as . It follows that increases with , so the maximum rejection probability over is at one. Any competing size- test for the composite null is also of level at most at rate one, and is bounded in power by the Neyman-Pearson lemma for each alternative. The test is uniformly most powerful for the composite hypotheses as well. This is the uniformly most powerful test for an exponential rate based on the sample sum.
Past exam of the mathematics course of the University of Cambridge 2016 ib Paper 3 20H c Solution Created 2026-09-24 Updated 2026-10-06
The specified gamma distribution uses shape and rate . Multiplying its density by the Poisson likelihood gives a posterior density proportional to . Thus the conjugate prior calculation givesFor squared-error loss, the posterior expected loss isIt is minimized at the posterior mean, so the Bayes estimator isFor a fresh conditionally independent Poisson observation, the posterior predictive probability of zero is the posterior expectation of . Evaluating the gamma integral givesThe samples are independent conditional on ; integrating out the uncertain common parameter produces the predictive probability above.
Past exam of the mathematics course of the University of Cambridge 2017 ia Paper 2 10F b Solution Created 2026-09-24 Updated 2026-10-05
Use the rate convention for the exponential distribution. By convolution of independent random variables, the probability density function of is, for ,It is zero for . The expression is nonnegative whichever rate is larger, and defines a two-stage hypoexponential distribution. As a check, its limit as is , the shape-two gamma distribution.
For , independence gives the survival function for . Differentiating its complement givesThus the minimum has an exponential distribution whose rate is the sum of the rates.
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 1 c Solution Created 2026-10-03 Updated 2026-10-06
An exact finite mixture model follows from the binomial theorem:Define positive mixture weightsHere is the Beta function, so the component probability distributions are . All coefficients are computable from the observed integer counts.
Use inverse transform sampling with the supplied to choose : writing and , take . Then recycle its position inside that interval,Recycling a uniform random variable after discrete sampling makes uniform independently of , since . It is also independent of all supplied random variables with gamma distributions. Transform these by the probability integral transform:They are independent random variables with uniform distributions because has a unit-rate exponential distribution.
Conditional on , put and . Form the values and return their th order statistic. This uses at most the supplied random variables with gamma distributions, since . The uniform order statistic formula givesAveraging these component probability density functions with weights recovers exactly the normalized posterior density. Unused inputs can be discarded. When , , , and the output is , as required. Interval endpoints and ties have probability zero; any consistent convention there is harmless. Exactness here concerns the mathematical algorithm; finite-precision arithmetic can be stabilized with logarithmic mixture weights.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 216 3 a Solution Created 2026-10-03 Updated 2026-10-06
Use the shape-rate convention for every gamma distribution, with . Let and . The Poisson distribution likelihood and the Gamma–Poisson hierarchical model giveAll factors involving the coordinate being updated must be retained, including from the conditional gamma distributions. The full conditional distributions areFor a blocked Gibbs sampler, draw from the second full conditional distribution, then redraw all the independently from the first ones. Repeating these two steps preserves the joint posterior distribution; observing after each complete sweep gives the Markov chain used in the next part. Standard gamma distribution sampling works for noninteger as well as integer shapes. The positive observation-period convention is used for the subsequent geometric drift condition.