Past exam of the systems biology course of the University of Cambridge 2024 Paper 3 2 b ii Solution 2026-10-20
TODO: Complete the data-specific numerical results and diagnostics when the original
Iris_data.csv is available.The identityshows that the likelihood function is a bell-shaped curve in , maximized at the sample mean, with width . Its actual vertical scale also depends on the within-sample sum of squares.
Continue the R script with:
sse <- sum((x - xbar)^2)
loglik <- function(mu) {
-n/2 * log(2*pi) - 0.5 * (sse + n * (mu - xbar)^2)
}
grid <- seq(3, 6, length.out = 2001L)
ell <- loglik(grid)
png("q2-likelihood.png", width = 900, height = 600)
par(mar = c(4.5, 4.5, 4, 1))
if (max(ell) > log(.Machine$double.xmin)) {
plot(grid, exp(ell), type = "l", xlab = expression(mu),
ylab = expression(L(mu)), main = "Likelihood on [3,6]")
} else {
# Explicitly label a proportional likelihood if the true scale underflows.
plot(grid, exp(ell - max(ell)), type = "l", xlab = expression(mu),
ylab = "Likelihood relative to maximum on plotted grid",
main = "Likelihood on [3,6] (rescaled)")
}
abline(v = xbar, col = "steelblue", lty = 2)
dev.off()Working first with the log-likelihood avoids premature numerical underflow. The fallback preserves the shape on the requested interval and labels the altered scale. A data-specific plot requires the missing CSV file; no fabricated observation set is used here.
Past exam of the systems biology course of the University of Cambridge 2024 Paper 3 2 b i Solution 2026-10-20
TODO: Complete the data-specific numerical results and diagnostics when the original
Iris_data.csv is available.The estimate requested is the sample mean, . The named electronic file
Iris_data.csv is not present in the supplied source archive or this repository, and its measurements are not printed in the paper. Consequently its numerical sample mean cannot be recovered from the paper alone. The familiar built-in iris data must not be silently substituted: the question does not identify those observations as its sample.The following R code reads the actual file and prints its sample mean. The later code blocks in Question 2 continue this same script and use the resulting
x, n and xbar.dat <- read.csv("Iris_data.csv", check.names = FALSE)
# Recognize common labels, or a single measurement column.
keys <- tolower(gsub("[^[:alnum:]]", "", names(dat)))
j <- which(keys %in% c("sepallength", "sepallengthcm", "x"))
if (length(j) == 0L && ncol(dat) == 1L) j <- 1L
if (length(j) != 1L) {
stop("Select the sepal-length column explicitly after inspecting names(dat).")
}
x <- dat[[j]]
stopifnot(is.numeric(x), length(x) > 0L, all(is.finite(x)))
n <- length(x)
xbar <- mean(x)
cat("n =", n, " sample mean =", format(xbar, digits = 12), "\n")This reader assumes a header row and one observation per row. An alternative layout should be identified explicitly rather than dropping measurements or treating an identifier column as a length.
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.
Pooled-mean compatibility under rounding Created 2026-10-25 Updated 2026-10-31
For a partition of a set of complete sample observations into groups of known sizes and total , its sample mean is the weighted mean of the group sample means. Indeed, dividing by proves the identity. If the printed group means each have absolute rounding error at most , their compatible pooled mean lies inThis follows because all the weights are nonnegative. Equivalently, the pooled absolute rounding error is at most , by the triangle inequality. A printed overall mean must have a rounding interval intersecting this interval. Disjoint intervals prove incompatibility, rather than merely a difference of displayed decimals. This is a necessary consistency check for means of the same complete sample; it cannot silently equate a full-sample mean with a different complete-case mean or establish a unique repair to inconsistent output.
Population mean 2026-10-25
The expected value of a numerical characteristic under the target population's probability distribution, when it exists. A sample mean estimates this fixed statistical parameter from observed data; it is not itself the population value.
Principal component score 2026-10-14
A score is an observation's coordinate along a principal component direction. Center an observation by the fitted sample mean, apply the fitted variable scaling when using principal component analysis on a correlation matrix, then take its inner product with the unit principal component loading vector. New observations must use the training center and scaling. The score variance equals the corresponding eigenvalue when the covariance normalization is consistent.
Q-Q plot 2026-10-13
A Q-Q plot is a scatter plot pairing quantiles at the same probability levels. For a statistical sample of size , sort the observations into order statistics . Choose plotting positions and a reference quantile function , then plotHere the horizontal coordinate is a reference value, and the vertical coordinate is an observed value; neither axis is the probability . The displayed plotting positions are our chosen convention, placing every level strictly between zero and one. They are not a claim that the th order statistic equals that population quantile. For two statistical samples, use sample quantiles at matching levels, with a stated interpolation convention when their sizes differ. [ref]
As a computed example, take and the standard normal quantiles , where is the standard normal cumulative distribution function. Construct the ordered values . At ranks , the plotting positions are , the reference quantiles are approximately , and the constructed values are approximately . Every point lies on by construction. These 19 values are deliberately chosen, not random draws or real measurements.
The usefulness of a Q-Q plot is that it turns a comparison of probability distributions into geometry: if a reference random variable is transformed into with , its quantile function satisfies . This follows because a positive scaling preserves ordering. Thus the location-scale family produces a straight population Q-Q plot, and an approximate sample line suggests a compatible shape over the observed range. Its intercept describes location and its slope describes scale. The identity line requires the same location, scale and units on both axes; even then its displayed angle is 45 degrees only with equal axis scales. Curvature is often more informative than a histogram because it shows which quantiles depart from the reference. [ref]
https://www.itl.nist.gov/div898/handbook/eda/section3/qqplot.htm. NIST/SEMATECH, Quantile-Quantile Plot, location and scale comparisons
Quantity-specific identifiability 2026-11-05
Quantity-specific identifiability asks whether a chosen function of a model's parameters is determined by the observable probability distribution, even when the complete parameter vector is not. For model and target , the criterion isEquivalently, the target must be constant on each class of observationally equivalent parameters. This separates identification of a scientifically meaningful quantity from reconstruction of every internal parameter. Thomas J. Rothenberg's primary treatment explicitly distinguishes identification of individual parameter components from that of a full system.[ref]
Identification in Parametric Models by Thomas J. Rothenberg. §5, printed p.586, individual-parameter discussion and Theorem8
For an original example, let observations have a Poisson distribution with mean , where . Parameter pairs and give exactly the same observable law. The sum is identifiable, but is not: its values are and . With independent observations, the sample mean estimates the sum with variance . More observations can improve that estimate without distinguishing the two allocations.
Identifiability from linear observations gives a useful exact criterion. Suppose the observation law identifies and contains no additional information about . A linear target is identifiable exactly when belongs to the row space of . To prove this, observationally equivalent parameter differences lie in the kernel of a linear map . The target is unchanged for every such difference precisely when is orthogonal to that kernel, which is equivalent to membership in the row space. If , the target can be recovered as .
A deterministic geometric analogue appears in additional measurements and anatomical identifiability: measured perimeter can determine the surface area of the stipulated cuboid family even when exchanging its two horizontal side labels remains invisible. The target and the allowed model class must be stated.
Raman peak-fit uncertainty 2026-11-05
Raman peak-fit uncertainty characterizes the uncertainty of a spectral-band position estimated by fitting a model to a Raman spectrum. It accompanies a Raman peak-position map: a colour difference between pixels need not establish a physical shift if the estimated positions are insufficiently precise. In Raman mapping, the instrument collects spectra at successive sample positions, and fitting extracts band parameters such as position and width.[ref]
What Raman images can reveal by Renishaw. “How do we collect Raman images?”; “How can I analyse Raman images?”, curve-fit parameters
For an isolated band, a least squares fit might estimate the center, height, width and background of a Gaussian function. The uncertainty assigned to its center is conditional on the chosen model and description of spectral noise. Repeating the complete acquisition and fit at one unchanged location provides another assessment: if independent center estimates have standard deviation , the estimated standard uncertainty of their sample mean is . This reduction applies to independent variation; it does not eliminate an offset shared by every acquisition.[ref]
Guide to the expression of uncertainty in measurement by JCGM. §4.2.1–4.2.3, independent repeated observations and standard uncertainty of their mean
For an original numerical example, model two fitted positions aswhere represents a shared uncertain additive correction from measurement calibration, while are independent fitting errors, also independent of . Suppose their standard uncertainties are and . Each position then has combined standard uncertainty . Their difference cancels the same , givingHere denotes standard uncertainty, so the difference has uncertainty about . The covariance term is essential: treating the two positions as entirely independent would instead give about . A common additive correction cancels only insofar as it really is shared; instrument drift between measurements or a scale error need not cancel.[ref]
Guide to the expression of uncertainty in measurement by JCGM. §5.2, equations13–16 and §5.2.4, correlated inputs and common measurement references
For a hypothetical stress model with an exactly known illustrative , this difference uncertainty contributes to the standard uncertainty of stress. Uncertainty in would require its own contribution. Raman peak-model bias, overlapping bands, an inadequate background and laser-induced sample changes can invalidate an otherwise small fit error. Retaining spectra and repeating fits with physically defensible models therefore matters alongside quoting a numerical uncertainty.
Rao-Blackwell estimator after interim selection Created 2026-10-06 Updated 2026-11-05
For two independent stage means and continuation , let and . The second-stage mean is conditionally unbiased. The Rao-Blackwell theorem gives , using and truncation. This is a conditionally unbiased estimator using both stages through their combined sample mean.
Rate function of an exponential sample mean Created 2026-10-14 Updated 2026-11-05
For independent and identically distributed exponential random variables of rate , the Sample mean has large-deviation speed and the displayed good rate function, infinite for . The cumulant-generating function is for . Its Legendre-Fenchel transform has maximizing parameter . For , sending gives infinite cost. The cost has its unique zero at and diverges at both ends of its positive domain.
Regression leverage Created 2026-09-24 Updated 2026-11-05
In fixed-design ordinary least squares with a full-column-rank design matrix , the fitted response is , whereThe regression leverage of observation is the diagonal entry of this hat matrix. Since is an orthogonal projection, lies between zero and one, and . Thus is the average regression leverage. These values depend on the design matrix, before any responses are observed.
If the errors have zero expectation and covariance matrix , the regression residual vector is , and idempotence givesFor simple linear regression with an intercept and a nonconstant predictor,An observation far from the predictor sample mean has large regression leverage: it can pull the fitted regression function toward itself and therefore have a small regression residual. Large regression leverage, a regression outlier, and an influential observation describe different properties; their combination, rather than regression leverage alone, determines how much deleting an observation changes the fit.
For simple pendulum oscillation period in the small-angle approximation, . If the length measurement and identically precise timing measurements have independent errors, the timing sample mean has standard error . Propagation of uncertainty gives the title formula. A target fractional standard uncertainty requires , rounded upward to an integer. No amount of repeated timing can beat the floor without improving the length measurement; correlated errors or a timing systematic error require a different model.
Reset pedestal variance 2026-11-05
Reset pedestal variance is the acquisition-to-acquisition variance of the output offset associated with integrator reset. In a model where the only fluctuating contribution is an opening charge on fixed capacitance ,Subtracting the mean of the reset charge-injection pedestal removes its constant component, not the random spread. The physical datasheet distinguishes charge-transfer offset from output noise; its charge-transfer limit alone is not a statistical variance specification.[ref]
ACF2101 Low Noise, Dual Switched Integrator datasheet. p3, Output Noise and Charge Transfer Errors; p11, Charge Transfer
Finite blank measurements introduce another contribution. Suppose independent pedestals have mean and standard deviation . Use independent zero-input acquisitions to estimate , then subtract that same blank sample mean from each of new signal acquisitions. With a constant signal and no other noise, the corrected mean hasThis variance of a pedestal-corrected sample includes the uncertainty of the shared correction. Its second contribution does not shrink when more signal acquisitions reuse the same blank estimate. Covariance-based uncertainty propagation retains such shared terms.[ref]
Guide to the expression of uncertainty in measurement by JCGM. §4.2.3, variance of an arithmetic mean; §5.2.2, correlated inputs
For original stipulated , and , the corrected mean has standard deviation . An exactly known pedestal mean would give . Repeated zero-input acquisitions at a fixed delay after switching measure the combined pedestal/readout spread; separating its mechanisms requires additional tests. Slow drift or correlations between acquisitions invalidate the independent-sample formula and must enter the measurement model.
Ridge regression Created 2026-09-24 Updated 2026-10-14
Ridge regression fits a linear regression model while penalizing the size of its slope regression coefficients. For a fixed design matrix containing the slope predictors, observed responses , and an unpenalized regression intercept , the objective isHere is the all-ones vector, and is the squared Euclidean norm of the slopes alone. The first term is the residual sum of squares; the second implements regularization. No random-error assumption is needed to define this fit. The convention is a summed squared-error loss: writing the objective as gives the same fit when .[ref]
Modern regression 1: Ridge regression. slides 5 and 7: summed squared-error objective and unpenalized intercept
For an exact example, reuse the constructed pairs from linear regression. Their sample means are and , and the centered cross-products are and . ThusThe ordinary least squares line has slope and residual sum of squares . At , ridge regression has slope , regression intercept , and residual sum of squares ; at these become , , and . Every line passes through : the penalty reduces the slope while retaining the response sample mean.
The computational benefit is visible after predictor centering. Write for the design matrix with each column's sample mean subtracted, and . The unpenalized intercept in ridge regression gives , and the closed-form ridge regression estimator solvesFor any nonzero vector and , . This positive-definite matrix is therefore invertible even when lacks full column rank, including repeated columns or . The unique penalized slopes resolve the ambiguity of rank-deficient ordinary least squares; they do not supply evidence about slope directions absent from the data. This makes ridge regression useful for multicollinearity.[ref]
High-Dimensional Regression: Ridge. p. 1, equations (1)–(2): uniqueness for positive penalty regardless of design rank
Predictor centering and scaling serve different purposes. Centering handles the free regression intercept. Scaling determines what counts as a large slope: replacing by changes its coefficient to for the same predictions, changing its contribution to an unweighted penalty. A common convention forms standard scores using each nonconstant predictor's sample standard deviation , then penalizes slopes in those coordinates. Since , this is the weighted penalty in the original units. Constant columns have and must be removed before this scaling. Scaling is a modelling choice; equal penalties in original units and in standardized units define different fits.[ref]
Modern regression 1: Ridge regression. slide 7: center predictors, leave the intercept free and scale predictors to sample variance one
The singular value decomposition explains the shrinkage. If is the compact decomposition using the positive singular values , with columns of , thenThe principal-component shrinkage by ridge regression factors are between and : directions with small singular values are damped most. As , the fitted values approach ; the vanishing-penalty ridge limit recovers the ordinary least squares fitted vector as , even if the slope estimates at zero penalty are nonunique. The covariance and bias of a ridge regression estimator describes the resulting bias-variance tradeoff. A penalty can reduce variance of an estimator while introducing bias of an estimator; the unbounded directional risk of fixed ridge shrinkage rules out a uniform improvement for a fixed positive penalty over all possible signals.[ref]
For a second exact construction, choose a centered orthonormal set of three vectors,and set and . The squared singular values are and . At , the fitted coordinates along are , retaining and of their ordinary least squares values . At they become , retaining and . The unfittable component contributes to every residual sum of squares, giving total values , , and at penalties . These are constructed fits, not measured prediction results.
Exact synthetic ridge shrinkage retains the strong singular direction longer than the weak one
. Details. The penalty is a hyperparameter, so fitting slopes at a fixed value and selecting that value are separate tasks. Use a validation set or K-fold cross-validation to compare candidate penalties by held-out squared-error loss. In each split, compute predictor sample means and scales from that split's training data, apply the same transformation to its validation set, and refit the slopes; using held-out information in preprocessing introduces data leakage. Minimum training residual sum of squares cannot select useful shrinkage: ordinary least squares already attains the smallest possible value.[ref]
Model selection and validation 1: Cross-validation. slides 5–8 and 11–14: tuning for prediction, training error and refitting on each training fold
After model selection, refit on all training data with the selected penalty. A separate test set or nested cross-validation assesses the entire selection procedure; a low selected validation score alone is no performance guarantee.[ref]On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation by Gavin C. Cawley and others. pp. 2079–2080: selection as part of fitting and nested assessment
Robust estimator 2026-11-05
A robust estimator is an estimator whose behavior remains acceptably stable under specified departures from an assumed statistical model. “Stable” must identify a criterion, such as limited bias under contamination, bounded response to a single extreme observation, or resistance to replacing a fraction of the sample. It does not mean that the estimator is accurate under every possible probability distribution.
For example, consider data with . The sample mean is , whereas the sample median, using the midpoint convention for an even-sized sample, is . Sending to infinity makes the sample mean diverge without changing that sample median. The example concerns location estimation: the population median and population mean need not coincide outside a symmetric reference model.
One formal model is Huber contamination:where is a reference probability distribution, is an unspecified contaminating probability distribution, and is its proportion. A robustness claim can bound an estimator’s worst bias over allowed , rather than only calculating its variance when the reference model is exactly true. Peter J. Huber’s original location paper treats this tradeoff systematically.[ref]
Robust Estimation of a Location Parameter by Peter J. Huber. Introduction, contaminated normal location models; section 4(iii), clipped location criterion
A Huber location estimator illustrates how stability enters the calculation. With a specified positive scale , solveLarge residuals have bounded scores, so one increasingly extreme point cannot contribute an arbitrarily large term to this equation. By contrast, the squared-error score grows linearly with the residual and yields the sample mean. A practical analysis must also state how is obtained: a scale estimate that itself explodes under outliers can undermine the intended protection.
Different criteria answer different questions. An influence function studies an infinitesimal perturbation of a distribution, while a breakdown point concerns a finite amount of sample corruption. A robust estimator can sacrifice some model-specific statistical efficiency to improve performance away from that model, but the amount depends on the chosen tuning and departure. Reporting the target parameter, reference model and robustness criterion makes the claim testable.
Robust statistics Created 2026-09-24 Updated 2026-11-05
Robust statistics studies how estimators and other statistical procedures respond to departures from a reference statistical model. Such departures can include a small fraction of outliers, a heavier-tailed probability distribution, or an incorrect assumed shape. A robustness statement specifies both the permitted departure and the quantity whose change is controlled.
For data with , the sample median remains , whereas the sample mean is and grows without bound. This does not make the sample median an estimator of every desired expected value: the mean and median of an asymmetric probability distribution can differ. The estimand must therefore be specified before judging robustness.
Influence functions describe infinitesimal changes, breakdown points describe large finite-sample failures, and minimax asymptotic bias compares worst cases over a neighborhood. M-estimators connect these questions with an explicit loss function. Peter J. Huber's 1964 location paper developed a systematic treatment of estimation under contamination.[ref]
Robust Estimation of a Location Parameter by Peter J. Huber. Introduction and location estimation under contaminated normal models
For a regular two-parameter exponential family, condition on the sample mean of the nuisance canonical statistic. Exponential tilting to its observed value and the saddlepoint density approximation give a nuisance-statistic density proportional to times its large-deviation exponential. Dividing the joint likelihood by this density gives the profile log-likelihood plus the displayed adjustment, up to a data-only constant. The sign is positive. This construction assumes an interior saddle with positive curvature and a sufficiently regular nonlattice density; conditioning on a lattice statistic requires the corresponding mass approximation.
Saddlepoint density of a Laplace sample mean Created 2026-10-14 Updated 2026-11-05
For independent unit-scale Laplace distributions, the cumulant-generating function is for . The saddlepoint density approximation solves , giving . At this tilt, and , giving the displayed probability density function approximation for the sample mean. Its value at zero is ; it need not integrate to one before normalization.
Sample correlation coefficient Created 2026-10-06 Updated 2026-10-14
For paired observations , the sample correlation coefficient isIt is the normalized inner product of the centered data vectors, or the sample covariance divided by the product of the corresponding sample standard deviations. The choice of divisor or cancels when used consistently in all three quantities. It is undefined if either centered data vector is zero, which occurs when that variable is constant in the observed statistical sample.
For and , both sample means are . The sum of centered products is , and each sum of centered squares is , hence the sample correlation coefficient is . This is a summary of these four observed pairs; it is not automatically the population Pearson correlation coefficient. Philip Stark, Computing the correlation coefficient explains the centered and standardized calculation.


