Control variates 2026-10-14
A control variate is a random variable with known expected value whose centered value is subtracted from a Monte Carlo estimator to reduce its variance. For a mean-zero vector , put and . When is invertible, the optimal estimator averages and has variance for independent draws. Improvement is strict exactly when .
Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 23 4 c Solution Created 2026-10-03 Updated 2026-10-14
Let have finite variance and mean . An independent-sample Monte Carlo estimator has variance , so its root-mean-square random error is . Three techniques reduce the variance coefficient rather than changing this ordinary rate.
For antithetic variates, couple with and average the pair. With independent pairs, the variance is , compared with for independent function evaluations. If is monotone in a scalar uniform, the covariance is nonpositive: for independent uniforms ,Opposite fluctuations therefore cancel. The reduction factor at equal evaluation count is , where is the paired correlation coefficient; it can approach zero, but positive covariance would make the method worse. This is appropriate for monotone or otherwise negatively coupled payoffs, with cheap complementary paths.
For control variates, use a jointly simulated with known mean and average . It remains an unbiased estimator for fixed , andCompleting the square gives and minimal variance . For contingent claim simulation, an analytically priced related financial payoff, such as a simpler option or discounted terminal stock, can be a useful control. It works best when correlation has large absolute value and simulation of the control adds little cost. A coefficient fixed from an independent pilot keeps the elementary unbiasedness argument valid; estimating it from the same sample can introduce finite-sample bias.
For stratified sampling, partition the sampling space into strata of probabilities , and independently simulate samples conditional on each stratum. The estimator is unbiased and has varianceWith proportional allocation , ignoring integer rounding, this equals . The law of total variance shows the reduction from ordinary sampling is : fixed representation removes randomness in the stratum counts. At equal per-draw cost, minimizing the displayed variance gives and minimum for positive within-stratum variances. This follows by Cauchy-Schwarz inequality and is useful when a low-dimensional coordinate strongly predicts the financial payoff and conditional simulation is easy.
There is no universal ranking. At comparable cost the variance factors depend respectively on paired covariance, squared control correlation, and within-stratum variation. A nearly perfect control can outperform a weak antithetic pair; an appropriate stratification can be almost exact for a nearly stratum-constant financial payoff. Extra construction and sampling costs must be included in a fair accuracy comparison, and the methods can be combined.
Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 35 4 c Solution Created 2026-10-03 Updated 2026-10-14
Let denote the strike, , and suppose , , and . Under the Black-Scholes model and the risk-neutral measure, is normal withApplying risk-neutral valuation to the European call option payoff givesUse , whose differential is precisely the normal density times . The threshold is , soEquivalently, rescale the tail interval to obtain on .
For independent uniform inputs, the Monte Carlo estimator is . It is unbiased, converges by the strong law of large numbers, and has variance . The payoff has finite second moment because the lognormal stock has finite moments. Its estimated standard error is the sample standard deviation divided by .
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 37 6 i d Solution Created 2026-10-03 Updated 2026-10-06
Apply the Monte Carlo estimator to the observable :The theoretical justification is the ergodic theorem for a positive Harris recurrent Markov chain, not an independent-sample law of large numbers. The Markov chain has finite state space, is irreducible, and has the strictly positive posterior distribution as invariant law, so it is positive recurrent and Harris recurrent with counting measure. The observable is bounded: . Thus the estimator converges almost surely to the posterior expected value from any initial configuration.
Each state also has positive self-transition probability, so the chain is an aperiodic Markov chain. Finiteness then gives geometric convergence and the relevant central limit theorem; serial dependence determines the Markov chain Monte Carlo asymptotic variance if error bars are required. A fixed finite burn-in can be discarded without changing consistency, but independence of the retained states should not be assumed.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 5 a Solution Created 2026-10-03 Updated 2026-10-06
Let be iid with density , set , and put and . The finite-second-moment assumption gives, for ,The sample variance consistently estimates . The central limit theorem and Slutsky theorem therefore give the asymptotic confidence intervalIts confidence probability is approximately , conventionally written ; the printed omits the factor . For , almost surely and the estimator has zero error. This interval concerns iid Monte Carlo estimators; correlated simulation output requires a long-run variance of a stationary process estimate instead of the iid sample variance.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 216 6 a Solution Created 2026-10-03 Updated 2026-10-05
Let . To distinguish the number of posterior draws from the training-sample size, write it as ; in the question's sample notation . The Monte Carlo estimator of the requested posterior mean isFor independent exact posterior draws it is unbiased, andThe features are conditioned on as fixed data. The estimated probability concerns a future genuine banknote under the posterior predictive probability, not an indicator sampled from that predictive distribution.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 216 6 b Solution Created 2026-10-03 Updated 2026-10-05
Put and . The probit regression likelihood is , so with the stated normal prior,Differentiating gives the probit posterior scoreEquivalently, the th likelihood term is . The prior's gradient is essential.
This posterior density is smooth, positive everywhere, and bounded above by a constant times the Gaussian prior, since the likelihood is at most one and has positive normalizing constant. Its derivatives are integrable: differentiating a likelihood factor gives a bounded normal density, and differentiating the prior gives a linear factor times a Gaussian. Integration by parts therefore yieldsThus each component has a known zero expected value and can be used as a posterior score control variate. This identity differentiates the posterior density in the random parameter; it is distinct from the usual mean-zero score identity for a likelihood under repeated sampling.
The requisite second moments are finite. For , is bounded. For ,Hence the score grows at most exponentially in , and the Gaussian upper bound on the posterior gives finite second moments. For a fixed vector , averaging is therefore an unbiased Monte Carlo estimator of the same mean; suitable coefficients can reduce its variance.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 219 2 b Solution 2026-10-03
Treat the simulated pairs as samples from the prior . The numerator and denominator of the posterior mean are then ordinary Monte Carlo estimators, sowhere the normalized importance sampling weights areThe common Gaussian normalizing constant cancels.
Past exam of the systems biology course of the University of Cambridge 2024 Paper 3 2 f Solution 2026-10-20
TODO: Complete the data-specific numerical results and diagnostics when the original
Iris_data.csv is available.Estimate the posterior mean by averaging the retained states:The exact truncated normal distribution reference isFor a posterior well separated from zero, the truncation correction is tiny and the posterior mean is approximately , slightly below the sample mean.
The R continuation prints the Monte Carlo estimator, its approximate batch-based Monte Carlo standard error, and the exact value for comparison:
posterior_mean_mc <- mean(post)
posterior_mean_exact <- m + s * exp(dnorm(m/s, log = TRUE) -
pnorm(m/s, log.p = TRUE))
# Nonoverlapping batches account approximately for serial dependence.
batch_length <- floor(sqrt(length(post)))
number_batches <- floor(length(post)/batch_length)
used <- post[seq_len(batch_length * number_batches)]
batch_averages <- colMeans(matrix(used, nrow = batch_length))
mcse <- sd(batch_averages)/sqrt(number_batches)
cat("Posterior mean, MCMC =", posterior_mean_mc,
" approximate MCSE =", mcse, "\n")
cat("Posterior mean, exact =", posterior_mean_exact, "\n")The batch length must be long enough relative to the chain's dependence for this uncertainty estimate to be reliable. No numerical data-specific posterior mean is determined by the supplied paper alone.
Posterior score control variate Created 2026-10-05 Updated 2026-10-14
If a smooth posterior density has vanishing boundary terms, its log-posterior gradient satisfies andThis is a posterior integration-by-parts identity; it concerns differentiation in the random parameter, distinct from the usual mean-zero score identity for sampling distributions. It makes a vector control variate. Finite moments and known coefficients preserve unbiasedness of the Monte Carlo estimator.