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 2022 iii Paper 218 4 c Solution by
Codex 0 2026-09-28
Conditionally on the school effect, the response variance is . Marginally,and two distinct students in the same school have estimated covariance .
There is no single coefficient estimate for the random effect because the 28 school deviations are modeled as draws from a mean-zero distribution. The summary reports the estimated distributional variance; individual empirical Bayes predictions can be extracted separately.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 4 b Solution by
Codex 0 2026-09-28
Treatment was assigned by school, so observations within one school are clustered data and plausibly correlated. A random intercept models shared unobserved school characteristics and prevents the effective amount of treatment-level information from being exaggerated by treating all students as independent.
The fitted school standard deviation is , so the estimated between-school variation is nonzero. Accounting for it raises the TV and SC standard errors from about in "lm1" to about in "lme1", reflecting that only 28 independently randomized schools identify those effects.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 4 a Solution by
Codex 0 2026-09-28
For student in school , "lme1" is the random-intercept linear mixed modelwhereindependently. The estimates areThe fixed intercept is the population-average expected post-study score for an untreated reference student with PTHK zero. The random intercept is school 's deviation from that population intercept.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 3 e Solution by
Codex 0 Created 2026-09-28 Updated 2026-10-03
For fixed , differentiating under the constraint givesBecause the columns are orthogonal,The fitted value is therefore , where is the orthogonal projection onto the column space of .
The residual sum of squares is minimized by choosing this column space to be the span of the leading eigenvectors ofThus may be taken to have those orthonormal eigenvectors as columns. Their nonzero scales are immaterial because inverse scaling of the scores leaves unchanged.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 3 d Solution by
Codex 0 2026-09-28
Principal component analysis centers the word-count vectors, diagonalizes their sample covariance matrix, and projects onto the eigenvectors with the largest eigenvalues. Fitting logistic regression to principal-component scores removes exact collinearity and yields a lower-dimensional design.
Each principal component is an unsupervised linear combination of many words chosen to explain predictor variance; it is not a word selected for association with spam. The dimension can be chosen from a scree plot or cumulative explained variance, but cross-validating the downstream classification loss better targets prediction.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 3 c Solution by
Codex 0 2026-09-28
Writing , the log-likelihood isWith 500 observations and 5000 word predictors, the augmented design matrix cannot have full column rank. There are nonzero coefficient directions that leave every unchanged, so any maximizer belongs to an affine family and is not unique. In addition, the high-dimensional features may completely separate the classes, in which case no finite maximizer exists at all.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 3 b Solution by
Codex 0 2026-09-28
The decision boundary is the hyperplaneAt threshold the classifier predicts spam whenso gives the original classifier. Varying translates the boundary parallel to itself: raising shrinks the region classified as spam and generally trades fewer false positives for more false negatives.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 3 a Solution by
Codex 0 2026-09-28
For word-count vector , the fitted logistic model isHolding other counts fixed, one additional occurrence of "dollar" multiplies the fitted spam odds by .
The logistic classifier isThe coefficients maximize the Bernoulli logistic-regression model likelihood over the training emails.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 2 e Solution by
Codex 0 2026-09-28
The successful hard-margin fit proves that the transformed observations are separable. This creates complete separation in unpenalized logistic regression: scaling a separating coefficient vector continually raises the likelihood, so no finite maximum-likelihood estimate exists. The nearly singular observed information produces the enormous reported standard errors.
A ridge-penalized logistic regression, or equivalently a Bayesian logistic model with a proper Gaussian prior, gives finite, stable coefficients. Firth bias reduction is another standard remedy.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 2 d Solution by
Codex 0 2026-09-28
The kernel trick replaces inner products by evaluations of a positive-semidefinite kernel without explicitly constructing the feature vectors. In the corresponding reproducing-kernel Hilbert space, the hard-margin problem isEquivalently, its dual isThere is no upper bound because this is the hard-margin, rather than soft-margin, problem.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 2 c Solution by
Codex 0 2026-09-28
The hard-margin constraints are feasible exactly when the classes are separated by a separating hyperplane. Failure after the corrections in part a therefore means the classes overlap.
Introduce slack variables of a support vector machine and solve the soft-margin problemsubject toLarge strongly penalizes violations and approaches the hard-margin solution when separation is possible. Small tolerates more violations in exchange for a wider, more strongly regularized margin.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 2 b Solution by
Codex 0 2026-09-28
The support vector machine classifier isUnder the constraints, the two classes lie beyond the parallel support-vector-machine margin boundaries . Their distance is , so minimizing the norm maximizes the geometric margin. The observations touching the margin are the support vectors.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 2 a Solution by
Codex 0 2026-09-28
First recode the labels as ; with labels and , the displayed constraints for class zero can never hold. Add an unpenalized intercept so that the separating hyperplane need not pass through the origin, and solveCentering and scaling predictor columns is also advisable because the Euclidean penalty depends on their units.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 1 d Solution by
Codex 0 2026-09-28
The null hypothesis isagainst the alternative that at least one coefficient is nonzero. The code uses the scaled reduction in exponential-family deviance,and compares it with .
That chi-squared calibration is appropriate when the dispersion is known, and is asymptotically valid after consistent dispersion estimation. With unknown Gamma dispersion, the standard finite-sample GLM comparison instead usesagainst an distribution. Its p-value is approximately , so the correctly calibrated test still rejects at the 5% level and gives evidence that component type or position contributes to mean failure time.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 1 c Solution by
Codex 0 Created 2026-09-28 Updated 2026-10-03
The score equation is independent of , because is only a common factor. Fixing or estimating it therefore gives the same maximum-likelihood estimator .
Under the usual full-rank and regularity conditions,with evaluated consistently at the fitted means. Consequently every standard error from "mod2" is times the corresponding standard error computed with dispersion one in "mod1". In particular,
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 1 b Solution by
Codex 0 Created 2026-09-28 Updated 2026-10-03
Let be row of the design matrix, , and . The full log-likelihood isDifferentiation gives the score functionandThe Hessian does not depend on , so the Fisher information matrix is
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 1 a Solution by
Codex 0 2026-09-28
Put and . The density can be writtenwhereThus this is an exponential dispersion family. Its derivative identities giveThe variance function is . In the usual Gamma-GLM convention the canonical inverse link isit differs by a minus sign from the natural parameter .
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 215 4 c Solution by
Codex 0 Created 2026-09-28 Updated 2026-10-03
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 215 4 b Solution by
Codex 0 2026-09-28
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 215 4 a Solution by
Codex 0 2026-09-28
For stationary edge flow , the bottleneck ratio isUsing in the variational characterization,Taking the infimum gives .
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





