Monte Carlo test 2026-10-07
Generate independent replicated datasets under a fully specified null hypothesis and calculate the same predictive discrepancy statistic for them and the observation. Their null exchangeability gives a finite-simulation rank test. The displayed add-one tail probability is valid with conservative treatment of ties, and avoids reporting zero solely because no replicate exceeds the observation.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 34 2 g Solution Created 2026-10-03 Updated 2026-10-07
A predictive discrepancy statistic is a specified measurable function of a possible dataset, chosen to detect a feature relevant to the null hypothesis. Under the fully specified null density , compare the observed with its reference distribution, derived analytically or from replicated datasets .
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 34 2 h Solution Created 2026-10-03 Updated 2026-10-07
Assuming independent digits under Benford law, put and . The count vector has a multinomial distribution, with expected counts . Suitable predictive discrepancy statistics include the Pearson chi-squared statistic and multinomial deviance:The zero-count terms of have limiting value zero. A Monte Carlo method gives a direct null comparison even when expected counts are small.
For example, an original R implementation is:Each column returned by
benford_check <- function(y, B = 9999L) {
p <- log10(1 + 1/(1:9))
n <- sum(y)
expected <- n*p
observed <- sum((y - expected)^2/expected)
replicas <- rmultinom(B, size = n, prob = p)
simulated <- colSums((replicas - expected)^2/expected)
(1 + sum(simulated >= observed))/(B + 1)
}rmultinom is a replicated count vector. R recycles the nine expected counts down each column. The add-one ratio is a Monte Carlo test estimate. In WinBUGS, alternatively generate a replicated dmulti vector using fixed , compute its discrepancy and monitor exceedance of the observed value. The null does not estimate unknown digit probabilities. Dependence or selection in the accounts would require an appropriate simulation model. Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 34 2 j Solution Created 2026-10-03 Updated 2026-10-07
Yes, the pattern merits checking. Digits two and three are visibly more frequent than the Benford law predictions, whereas several large digits are scarce and nine is absent. Rough agreement for one and four does not remove this pattern.
Use the predictive discrepancy statistic comparison in part (h), together with examination of the accounts' selection and constraints. A discrepancy is evidence against this digit model, not by itself evidence sufficient to establish fabrication. No numerical test calculation is needed for this qualitative assessment.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 34 4 f Solution Created 2026-10-03 Updated 2026-10-07
Integrate each supplied predictive density to get its cumulative distribution function , then form the sequential probability integral transformFor a correct continuous one-step conditional predictive model, . Iterating this identity shows that the are independent uniform variables. A histogram or quantile plot checks uniformity; serial plots and autocorrelations check for temporal structure left unexplained by the forecasts.
Also inspect empirical coverage of central prediction intervals, tail exceedances and interval widths, assessing calibration together with sharpness. These checks need only the supplied forecasts and observations. Compare chosen predictive discrepancy statistics with simulated uniform reference sequences. A total log score alone is a relative reward and does not provide a universal absolute goodness-of-fit threshold.