Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 6 a Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
There is a literal domain error in the printed formula. A semivariogram indexed by a signed displacement must satisfy , since reversing the two observations leaves the squared increment unchanged. For positive or , the displayed positive-lag value is nonzero whereas the displayed negative-lag value is zero. Thus the claim on all of is false as written.
Interpret the argument as a nonnegative distance, or use the even extension of the Gaussian semivariogram. For and , the intended model isIt admits the covariogramThe Gaussian kernel is a positive-definite kernel, as can be seen from the Fourier transform of a Gaussian: in one dimensionand the nonnegative spectral density makes every finite covariance quadratic form nonnegative. In higher dimensions use the product Gaussian density. Adding independent Gaussian white noise of variance adds the diagonal nugget covariance. Thus a zero-mean stationary Gaussian random field exists with this covariance, and gives the corrected semivariogram.
For nonzero structured variance, the nugget effect is the right limit at zero, the sill of a semivariogram is , and the range of a semivariogram is infinite if defined as the distance at which the sill is exactly reached. A 95-percent practical range solves :The scale is sometimes called the range parameter; it is neither the exact range nor the 95-percent practical range. If , there is no nontrivial structured range.
The fact that a semivariogram does not determine stationarity is a further distinction: a semivariogram specifies increment variation, not a unique process or absolute covariance. Adding an independent random constant adds a constant to without changing . More strongly, subtracting from a stationary field preserves its semivariogram but generally makes its variance depend on . The corrected statement is that this semivariogram admits a second-order stationary model, with the displayed covariance using the usual convention at large distance; it does not force every compatible process to be stationary.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 5 e Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
Let contain observations through time . In the Gaussian moving-average process of order one, the innovations inare independent of . Hence the conditional expectation is the constant mean. For known parameters, the forecast and its mean squared prediction error areThe mean prediction error itself is zero; the requested uncertainty is naturally interpreted as expected squared error. Plugging in the fit gives forecast , mean squared error , and root mean squared error about .
The usual naive time-series forecast repeats . Its unconditional expected squared error issince . ThusConditional on , the naive error is , explaining directly why the conditional-mean forecast is better under squared-error loss. These are fitted-model calculations that ignore parameter-estimation uncertainty. Estimating the unknown mean from the past adds its estimation mean squared error to the seven-step forecast risk; the printed summary does not provide a complete assessment of that extra uncertainty. This is distinct from claiming a signed mean error as a measure of forecasting accuracy.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 5 d Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
The selected model is a moving-average process of order one, with the plus-sign convention used by R:The Gaussian likelihood function models innovations as independent . Its autocovariance is , , and zero at larger lags, with autocorrelation . The estimated coefficient has modulus less than one, giving invertibility of a moving-average model; a finite moving-average process is stationary regardless of this invertibility restriction.
The original plots show fluctuations around a roughly constant level, no persuasive deterministic trend, and a conspicuous positive lag-one correlation with the other plotted correlations within the approximate sampling bands. They make a stationary nonseasonal working model reasonable for this short series.
stationary=TRUE excludes differenced alternatives, and seasonal=FALSE excludes seasonal ARIMA terms. Neither option is proved by a 60-day plot: annual temperature seasonality cannot be excluded from two months, and a longer record or residual diagnostics might require a different model. The options are reasonable local simplifications, not universal statements about temperature dynamics. Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 5 c Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
A zero-mean autoregressive process of order one satisfieswhere is white noise with variance . A causal time series uses present and past innovations only. For the serieshas mean-square convergence because , and it supplies the causal weakly stationary process. Its variance is . For , only the common innovations contribute to the autocovariance:Evenness then givesWhen , the signs alternate; when , the process is white noise. With nondegenerate innovations, does not give a causal finite-variance stationary solution. These covariance calculations need uncorrelated innovations, not Gaussianity; Gaussian innovations additionally yield a Gaussian process.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 5 b Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
For a known mean zero, a common sample autocovariance function convention isThe weakly stationary process property gives , soThe lag-zero estimate is unbiased, but at nonzero lags the divisor causes a finite-sample multiplicative bias. An alternative convention uses instead; for that convention the expectation is exactly . These are two normalizations of the sample autocovariance function, so the divisor must be specified. Here no estimated-mean centering term occurs because zero is known. Replacing zero by a sample mean would introduce additional bias terms. Extend to negative lags by symmetry; there are no observed lagged pairs for .
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 5 a Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
For a weakly stationary process, every observation has the same finite expectation . Linearity of expectation, without any assumption of independence, givesThe variance is a sum of all pairwise covariances:For a real-valued weakly stationary process, the autocovariance is even. There are pairs at lag zero and pairs in each direction at positive lag . ThereforePositive autocovariances inflate the uncertainty relative to the independent-observation formula; negative terms may reduce it. An unbiased estimator need not have variance tending to zero: a process consisting of the same random variable at every time is weakly stationary, but averaging cannot reduce its variance.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 4 e Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
The command fits a Gaussian generalized additive mixed modelThe population growth curve is a centered penalized regression spline with a cubic regression basis. The incubator term remains a random slope without a random intercept, because
~0+hours removes the intercept. A population linear component is allowed within the smooth's unpenalized part; curvature is penalized rather than being required.A Inspect whether the fitted curve departs materially from an affine function, particularly in regions supported by observations. The effective degrees of freedom near one suggest that the penalization has selected an approximately linear centered smooth. Bands and partial residuals help distinguish convincing curvature from noisy deviations, although pointwise bands are not a simultaneous test of linearity. A formal comparison would need to account for both smoothing selection and the incubator dependence. The smooth plot tests the visual plausibility of a common straight growth curve while retaining incubator-specific slope variation.
gamm fit returns a list with gam and lme components. Plot the population smooth and pointwise uncertainty bands withplot(fly.model2$gam, se=TRUE, residuals=TRUE) Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 4 d Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
Add a location-specific random intercept to the random-slope linear mixed model:Take the location effects, incubator slopes and individual errors to be mutually independent, with the original variances and . The random intercept models variation already present at hatching because of the origin of the eggs. Because larvae are subsequently assigned to incubators, location and incubator are crossed random effects, not automatically nested groups. The corresponding code isThe resulting covariance between two observations contains if they share a location and if they share an incubator. If the three named locations themselves are the only populations of interest, use a fixed location factor instead:Choosing between these interpretations depends on the inferential target; with only three locations, a location variance component will be weakly estimated.
fly.model.loc <- lmer(size ~ hours + (0+hours|incubator) + (1|location))fly.model.loc.fixed <- lmer(size ~ hours + location + (0+hours|incubator)) Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 4 c Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
The marginal Akaike information criterion is , where counts estimated population parameters. Here they are , so . The realized incubator slopes have been integrated out of the likelihood function; they are not four additional free population coefficients. From the marginal Gaussian log-likelihood, the expression isAll hats here denote the ordinary maximum likelihood estimation fit.
The displayed value is instead a restricted maximum likelihood criterion. Thus it cannot simply be substituted for the ordinary maximum-likelihood deviance. The The output does not contain that numerical answer. In particular, restricted criteria must not be used to compare models with different fixed-effect designs. A conditional AIC targeting predictions for existing groups is yet another criterion and does not follow by counting each latent slope as an ordinary parameter.
logLik method defaults to the fitting convention. If one applies AIC(fly.model) directly to the displayed REML object, the default restricted log-likelihood and the same parameter count give the software's restricted-likelihood-based value . This number should be labelled as such; it is not the ordinary marginal AIC derived above. To obtain the latter, refit and calculateAIC(update(fly.model, REML=FALSE)) Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 4 b Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
Let have columns , and let have one column per incubator, with entry in the column for observation 's incubator and zeros elsewhere. Integrating the Gaussian random effects givesConsequently its marginal log-likelihood isThe likelihood-ratio test of against usesFor each covariance, the optimizing coefficients are the generalized least squares estimator . Both fits should use the same marginal likelihood convention, for example fitting the alternative with
update(fly.model, REML=FALSE) and the null as a Gaussian linear model. The displayed alternative REML criterion alone cannot supply .The variance component is constrained to be nonnegative, and zero lies on the boundary. Thus the interior-parameter hypothesis of Wilks theorem fails; the usual approximation is inappropriate. A limit sometimes applies to a single variance component under additional asymptotic conditions, but four incubators do not give a persuasive large-number-of-groups approximation.
Use a parametric bootstrap under the null: estimate there; simulate independent Gaussian errors with that fitted variance at exactly the observed times and grouping labels; refit both models by maximum likelihood for each simulated sample; and calculate . The upper-tail proportion, conventionally , estimates the p-value. Boundary fits with estimated must remain in the simulation distribution. A restricted-likelihood ratio and a correspondingly calibrated bootstrap are another option when the fixed-effect design is identical, but one must not mix ordinary and restricted likelihoods in a single statistic.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 4 a Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
The random-slope linear mixed model iswith independence between the random effects and errors. The estimates areIncubators are treated as exchangeable representatives of possible growth environments, so a random slope permits their growth rates to differ while estimating a population mean growth rate. The formula
0+hours deliberately removes a random intercept: larvae are assigned only after hatching, so it is reasonable to assume no incubator-specific baseline at time zero. Random assignment supports this common-baseline assumption in expectation; it does not prove that observed initial sizes or other baseline differences are exactly identical.For a new incubator, no observations are available to estimate its realized random slope, and its mean effect is zero. Under squared-error loss the best prediction integrates over that effect and the residual error:This is the plug-in conditional expectation given the population parameters, rather than a prediction using a fitted effect from one of the four existing incubators. Ignoring parameter-estimation uncertainty, the prediction variance for a new individual is ; it is not just the uncertainty in the population mean.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 e Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
There is a genuine syntax error in the printed command: With the default Gaussian family, this generalized additive mixed model isHere across doctors, is an estimated covariance matrix, and the Gaussian errors have variance and are independent of the random effects. The formula
random=list(...) must be a separate argument, following a comma rather than a plus. The intended call ismodel2 <- gamm(npres ~ s(age, bs="cr") + s(wbc, bs="cr"), random=list(doctor=~age))~age includes a random intercept as well as a random slope; it does not force these two effects to be uncorrelated.The random intercept allows different prescribing baselines, and the random slope allows doctor-specific linear modifications to the population age curve. Conditional on these effects the observations are independent under the model, whereas two patients of the same doctor have additional covariance . This accounts for clustered data and avoids treating doctor variation as independent patient-level noise. The population smooth and doctor-specific predictions are different targets. With only four doctors, estimates of the random-effect covariance can be imprecise; the Gaussian support issue for counts also remains. The new model accounts for doctor-specific baselines and age slopes.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 d Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
Because no family is specified, the command fits a Gaussian identity-link generalized additive model:The are centered penalized regression splines with cubic regression bases; centering separates them from the intercept. The age curve in the original figure falls to a minimum near age 25, then rises markedly, particularly from about 40 onwards. Its effective degrees of freedom are , reflecting curvature. The white-cell curve has effective degrees of freedom one and is nearly flat with a slight positive slope; the pointwise uncertainty bands are consistent with no substantial effect. These plots display centered partial mean contributions, not numbers of prescriptions by themselves.
A simpler mean model keeps the age regression spline and replaces the white-cell smooth by a linear term. A separate issue is that the response is a nonnegative count: a Poisson regression with logarithmic link function respects that support and positivity of the mean. A reasonable candidate isIf diagnostics show overdispersion, one can fitusing a negative binomial regression. Alternatively, if a Gaussian approximation is adequate, the minimal simplification is
model1p <- gam(npres ~ s(age, bs="cr") + wbc, family=poisson(link="log"))
gam.check(model1p)model1nb <- gam(npres ~ s(age, bs="cr") + wbc, family=nb(link="log"))gam(npres ~ s(age, bs="cr") + wbc). These are candidates to compare by diagnostics and validation, rather than guaranteed improvements from the partial plots alone. Retain the curved age effect; consider a linear or removable white-cell effect, and assess an appropriate count family. Refit before interpreting the old curves on a new link scale. Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 c Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
For , minimize the smoothing spline objective over the Sobolev space of functions with square-integrable second derivative on the observed interval:The roughness penalty measures curvature; its null space consists of affine functions. To see why the minimizer is a natural cubic spline, let be the natural spline interpolating the values of any competitor at its distinct observation locations, and put . Integration by parts twice on each knot interval gives : on each interval, vanishes at the knots, is continuous, and vanishes at the outer endpoints. Hencewhile both functions have the same residual sum of squares. This proves the reduction to a finite-dimensional spline space.
For distinct and , use its -dimensional basis, write , and define the positive semidefinite matrixThe penalized least squares problem is , soUse linear continuation outside the observation interval. The fitted-value matrix is ; its trace gives the effective degrees of freedom. As decreases to zero, the natural spline approaches interpolation, with trace ; as it grows without bound, the fit approaches ordinary least squares on , with trace two. For the criterion alone does not determine values between observations; the natural interpolant is the limiting convention. Repeated observation locations are combined by using distinct knots and their multiplicities as weights, rather than pretending the spline design has independent interpolation values.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 b Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
Choose knots independently of the eventual validation responses, and let be a natural cubic spline basis as in part (a). A regression spline writes . Define the design matrix . Under the stated normal linear model, maximum likelihood estimation for is the same as ordinary least squares:Differentiation gives the normal equations . If the design has full column rank,If it does not, a Moore-Penrose inverse gives the fitted values, but not every coefficient or off-sample prediction is identifiable. Merely choosing distinct knots does not guarantee full rank for an arbitrary set of observed predictor values.
More knots allow greater curvature and reduce approximation bias at the cost of larger estimation variance. Too many or poorly located knots can cause unstable fits. Equally spaced knots are simple; empirical predictor quantiles put more flexibility where observations are dense; subject knowledge can concentrate knots near likely changes. Both the number and positions can be compared using cross-validation or an appropriate penalized model-selection criterion. Adaptive knot selection must be included within validation, since treating a data-selected basis as prespecified understates its flexibility. Boundary knots should cover the region where inference is intended, and natural linear tails do not by themselves justify far-out extrapolation.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 a Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
With distinct knots , a natural cubic spline is a function on the real line, cubic on each interval between consecutive knots and affine outside the two outer knots. The latter condition gives .
There are coefficients for the interior cubic pieces. Matching values and the first two derivatives at the interior knots imposes independent constraints, and the two natural endpoint conditions impose two more. The affine continuations are then determined by endpoint values and slopes. The dimension of a vector space is thereforeOne explicit basis uses and for , whereThe cubic and quadratic terms cancel in each difference above , making it affine there; below the truncated powers vanish. The changes in third derivative at individual knots show independence of these basis functions. This count uses the linear independence of the spline constraints and counts the listed outer knots as boundary knots. If a convention instead lists interior knots and two additional boundaries, the dimension is . With only one listed knot and linearity on both sides, the condition forces a globally affine function, so the exceptional dimension is two.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 2 d Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
The quasibinomial regression retains the logit link and mean function but uses the working variance function . Its quasi-score equation isso multiplying by the common dispersion parameter does not change the coefficient estimates. Iteratively reweighted least squares therefore gives the same fitted means and coefficients as the binomial model. The usual Pearson dispersion estimator isThe estimated coefficient covariance matrix is , with . From the intercept standard errors, ; the rounded slope errors give approximately the same factor. The display uses approximate Student's t-tests with 118 residual degrees of freedom instead of fixed-dispersion normal tests.
For a genuinely individual binary response, the Bernoulli distribution identity forces . Thus is a working quasi-likelihood specification, not a different independent binary distribution with that mean. The mild estimated underdispersion does not establish an improved model, and the mean predictions are unchanged. In particular, a scalar rescaling does not model correlation among users, and usual likelihood-based Akaike information criterion comparisons are unavailable for a family without a specified probability likelihood. The output gives no convincing reason to prefer model3 to model2.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 2 c Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
Using the smaller logistic regression, approximate pointwise Wald confidence intervals are an estimate plus or minus times its standard error:Both intervals rely on the large-sample normal approximation and correct model assumptions. The negative slope indicates decreasing purchase probability as price rises. A one-unit price increase multiplies the odds by ; it does not subtract a fixed amount from the probability. There is no significant additional layout effect in the previous likelihood-ratio test, rather than a demonstration of no effect.
In the selected model layout B has the same prediction rule as the other layouts. At price 100 the linear predictor is . Applying the inverse logit link givesThe intercept refers to price zero; if that lies outside the observed price range, its direct substantive interpretation would require extrapolation.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 2 b Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
There are observations, since the intercept-only model has residual degrees of freedom. Adding price introduces one coefficient and decreases the binomial deviance by . Adding a three-level factor introduces two coefficients and decreases it by . Thus the missing entries areThe likelihood-ratio test comparing the smaller and full logistic regression tests against at least one nonzero layout contrast. Its statistic is . Under ordinary interior-parameter, full-rank and finite-estimate regularity conditions, Wilks theorem gives an asymptotic chi-squared distribution with two degrees of freedom. The reported p-value exceeds , so at that level retain the simpler price-only model.
The table is an analysis of deviance for nested generalized linear models: price is entered before layout. Thus its price row tests the price-only model against an intercept, whereas the layout row tests layout after allowing for price. The latter is the relevant comparison of model1 and model2. Failing to reject a layout effect is not proof that layouts have identical effects; it means these data do not justify the extra two parameters under this test.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 2 a Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-05
For independent random variables , the full logistic regression has linear predictorLayout A is the reference level in a regression factor. The smaller model sets , leaving the same logit link and the price predictor. In either caseThe saturated statistical model allows a separate probability per observation; its maximizing probabilities are , with log-likelihood zero under . Hence the binomial deviance for either fitted model isEquivalently, write the summands as . The fitted probabilities differ between the two models, but the definition of binomial deviance is the same. A residual deviance for individual binary data need not itself have an accurate chi-squared distribution approximation; the nested-model difference used next has a different asymptotic justification.
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





