Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 30 3 a Solution Created 2026-10-03 Updated 2026-10-14
Principal component analysis replaces correlated measurements by orthogonal linear coordinates ordered by their variance. For centered observations collected in an matrix , write the sample covariance matrix as . A unit loading vector gives score vector with sample variance . The Rayleigh quotient is maximized by a unit eigenvector of for its largest eigenvalue.
The subsequent principal components maximize the same quadratic form subject to orthogonality to the earlier loading vectors. By the spectral theorem, if with descending eigenvalues, the scores have diagonal covariance . Their fractions of explained variance are . Repeated eigenvalues identify an eigenspace rather than a unique axis.
Keeping the first principal components gives the rank- reconstruction . Its squared reconstruction error isFor any rank- orthogonal projection , retained variance is . The weights lie in and sum to , so this is at most the sum of the largest eigenvalues. Projecting onto any candidate reconstruction subspace is its best least-squares reconstruction; this proves the minimum-error property and agrees with the singular value decomposition. Thus PCA finds the linear subspace preserving the greatest variance, equivalently minimizing squared reconstruction error. The upper-left sketch shows the first axis aligned with the elongated cloud; the second is perpendicular. A scree plot and substantive interpretability help choose .
Original sketches of principal components, classical scaling, hierarchical clustering and multivariate mean comparison
. Details. These methods depend on measurement scale. A variable measured in large numerical units can dominate covariance-based principal component analysis; standardizing variables gives principal component analysis on a correlation matrix. Scores summarize patterns, but the method neither establishes causation nor guarantees that the largest-variance directions best predict a separate response.
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 39 2 Solution Created 2026-10-03 Updated 2026-10-14
The calculation is principal component analysis on a correlation matrix, rather than on an unscaled covariance matrix. For each of the eleven rating variables, subtract its column mean and divide by its column standard deviation. If is the resulting matrix, use the divisor convention of the fitted object to writeHere the scaling standard deviations use divisor , consistently with this convention. Using sample standard deviations with divisor gives the same correlation matrix and directions, with the corresponding score scale. Every diagonal entry of is one, so .
A principal component is the linear combination of the standardized ratings along . Its principal component score for judge is , and its variance is . The displayed component standard deviations are ; the explained variance of a principal component is . In particular,The first component explains about of the standardized variation, and the first two jointly explain . Components three, four and five add about , and . The cumulative line adds these proportions successively; it is not the proportion explained by that component alone. Retaining two components discards about of the total standardized squared variation.
The displayed principal component loadings are the unit eigenvector coefficients . The first direction has positive, broadly similar weights for all ratings. It measures an overall favorable-rating tendency: a judge high on most ratings has a high first score. The second direction compares integrity and demeanour, with large positive coefficients, against such attributes as decision promptness, case-flow management and physical ability, with negative coefficients. Thus among similarly rated judges, a positive second score indicates relatively stronger integrity/demeanour compared with those operational ratings. This is a description of a data direction, not a causal interpretation. Multiplying a whole eigenvector and its scores by minus one reflects the display but changes nothing substantive.
These principal component loadings are not themselves variable-component correlations. With standardized variables,For example, the integrity correlation with component one is approximately . Blank loadings in the printed second column indicate suppressed small entries, not exact zeros. The complete unrounded loading vectors in the fitted object must be used to calculate scores.
A two-dimensional representation plots the 43 pairswith each point labeled by its judge. In the fitted software object these are the first two columns of the score matrix. Nearby points have similar projections of their standardized ratings. The rank-two reconstruction is the orthogonal projection onto the leading principal plane and minimizes the total squared reconstruction error over all two-dimensional linear subspaces. To see this, for any orthonormal pair of directions the captured variance is the sum of its two Rayleigh quotients, at most by diagonalizing ; the remaining variance is the total minus that captured sum. Distances in the plot omit the smaller components, so a close projected pair need not be equally close in every original rating. The actual 43 coordinates cannot be recovered from the summary alone; the supplied data matrix or fitted score matrix is needed.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 42 3 ii Solution Created 2026-10-03 Updated 2026-10-14
The command centres the log measurements and performs principal component analysis of their covariance matrix. With
cor=F, it does not first standardize the variables to variance one. For a unit principal component loading vector , the score has sample variance . By the spectral theorem for real symmetric matrices, expand in an orthonormal eigenbasis; that variance is a weighted average of the eigenvalues. Its maximum is the largest eigenvalue, reached at the corresponding eigenvector. Repeating subject to orthogonality to previous directions gives the other principal components.The software uses the divisor- sample covariance matrix for its component standard deviations, whereas
var used divisor . Diagonalizing the displayed matrix gives approximatelyTaking square roots of the latter gives , agreeing with the output to the rounding of the displayed sample covariance matrix. The normalization changes these numerical standard deviations but leaves the eigenvectors and proportions of explained variance of a principal component unchanged.The first principal component explains about of the total log-variable variance, the second another , and the last about . Keeping two preserves about . An original scree plot displays the sharp drop after the first component:
Consequently the centered cloud is very elongated along one direction: a one-dimensional approximation represents almost all of its squared variation. From the displayed covariance matrix, a unit first eigenvector, with its arbitrary sign chosen positive, is approximatelyIts principal component score is therefore . All coefficients have the same sign, so this direction describes overall tree size, with log volume dominating the unstandardized variation. The summary alone supplies proportions, not the loading directions; the displayed sample covariance matrix supplies the latter. This is a geometric approximation, not evidence of an exact deterministic relation or independent original variables.
One further use is principal component analysis on a correlation matrix, obtained with
cor=T, which equalizes marginal variances and answers a different scaling-sensitive question. Another is principal component regression: fit a response to selected principal component scores rather than highly correlated original predictors, choosing the number using prediction assessment. The fitted transformation also projects new measurements into the same low-dimensional coordinates, provided the training centering and scaling are retained. Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 43 4 Solution Created 2026-10-03 Updated 2026-10-14
princomp(): principal component analysis. Supply observations in rows and numeric variables in columns. After centering, let denote the resulting matrix and its sample covariance matrix, with an explicitly stated normalization. WriteThe first direction maximizes the Rayleigh quotient over unit vectors; successive directions maximize it subject to orthogonality to the earlier directions. The principal component scores are , with variances and zero pairwise sample covariance. Zero covariance alone does not imply independence. Each principal component loading describes a direction in variable space; its sign is arbitrary, and repeated eigenvalues leave the basis inside the corresponding eigenspace arbitrary.The function returns principal component loadings, component standard deviations
sdev and, when requested, principal component scores. By default it uses a covariance matrix; cor=T instead performs principal component analysis on a correlation matrix, standardizing nonconstant variables to variance one. This choice matters when variables have different measurement units. These interface details are documented in the S-Plus help for princomp.A scree plot shows the ordered eigenvalues; a plot of the first two principal component scores can reveal groups, unusual observations or a dominant gradient. The first components explain of the total variance. Reconstructing each centered observation by its orthogonal projection onto these directions minimizes average squared reconstruction error among -dimensional linear subspaces. Thus PCA gives an optimal linear compression for squared reconstruction error, with scaling and the retained dimension chosen explicitly. It is an unsupervised learning method, rather than a classification rule fitted to supplied labels.
tree(): classification trees and regression trees. A call such as tree(response ~ predictors, data=dat) fits a recursive partitioning model. At a current node, test numerical predictors against candidate thresholds, or divide the levels of a categorical predictor into two sets. Select a split that most improves the fitting criterion, then repeat within its children. Numerical splits give axis-aligned regions. A categorical response produces a classification tree; a numeric response produces a regression tree, as specified in the S-Plus tree documentation.For a regression tree, the constant prediction in a terminal region is its sample mean, minimizing the sum of squared residuals there. For a classification tree, estimate class probabilities by the observed proportions in a leaf and predict a most probable class under equal misclassification costs. The classification-tree deviance of a node iswith ; splitting maximizes the decrease from parent to children. This fitting criterion differs from the number of wrong classifications. The middle sketches show the same three-region partition as a binary tree: first split on variable one, then split the right-hand branch on variable two.
Growing to small leaves can overfit. Use cost-complexity tree pruning, balancing fitted loss against leaf count,and select complexity by cross-validation. Plotting the fitted tree and annotating nodes displays the rules; prediction routes each new observation through the fitted splits. A tree gives an interpretable, piecewise-constant prediction rule; training fit alone does not measure prediction accuracy.
The
rpart() alternative. This also fits classification and regression trees by recursive partitioning, with squared-error splitting for ordinary numeric responses and, by default for classification, Gini impurity . Classification settings can instead use information-based splitting and specify prior probabilities and a loss matrix. It supports surrogate splits to approximate a node's primary left/right assignment when the primary predictor is missing. Its complexity-parameter path and cross-validated errors support cost-complexity tree pruning; for example, select a complexity parameter and apply prune(fit, cp=...). The maintainer's rpart documentation describes the criteria and the distinction in handling surrogate predictors. The partition and tree sketches apply to either implementation; the fitted tree need not be the same because splitting criteria and controls can differ.cmdscale(): classical multidimensional scaling. Its input is a dissimilarity matrix or stored distance object. It outputs coordinates for the observations in a chosen dimension, usually two for visualization. Let contain the squared entries of , and putFor centered Euclidean coordinates , the distance identity gives : multiplying by removes the row and column norm terms. Diagonalize this Gram matrix and retain its largest positive eigenvalues. The coordinates areThus classical scaling exactly recovers Euclidean distances when all positive eigenvalues are retained. Reducing dimension approximates the centered Gram matrix; it does not in general minimize squared discrepancies in the original distances. Negative eigenvalues identify a failure of the Euclidean distance matrix criterion, so their size matters when interpreting a display. The historical S-Plus cmdscale help describes the dimension argument, eigenvalue output and optional additive adjustment to dissimilarities.Plot the two coordinate columns on equally scaled axes and label observations. Nearby plotted points suggest small dissimilarities only insofar as the dimension reduction fits the input well. The bottom sketches give an exact Euclidean example: a configuration and its independently recovered two-dimensional coordinates have identical pairwise distances, despite different coordinate axes. Classical scaling converts distances into geometry; translations, rotations and reflections do not change the represented distances. For Euclidean distances between observations, its coordinates agree with the corresponding principal component scores up to these harmless choices of axes.
Illustrative PCA directions and scree plot, equivalent recursive partition and tree, and exact classical-scaling recovery of Euclidean distances
. Details. Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 46 2 Solution 2026-10-14
For the sample, put and use the sample covariance matrixOrder its eigenvalues decreasingly and choose unit orthogonal eigenvectors . The sample principal components are the score columnsTheir sample means are zero and their sample covariance is diagonal, since . The th sample variance is , and its explained variance of a principal component is . Using divisor instead changes the numerical variances by a common factor but leaves the component directions unchanged.
Standardizing means replacing a variable with positive sample variance by . This gives principal component analysis on a correlation matrix, using with . It removes arbitrary differences of measurement units and prevents a large-variance coordinate from dominating solely through its scale. It also changes the question being optimized: small-variance and possibly noisy coordinates receive equal marginal weight. Principal component analysis based on the covariance matrix can be more appropriate when the variables have common meaningful units and absolute variability matters. Standardization is therefore a substantive choice, not an automatic improvement. A zero-variance variable must first be removed. In the word-rating example the variables share the same numerical range, but their across-word dispersions can differ; standardization gives each attribute equal initial variance.
For the standardized eight-variable analysis, total variance is . The first three fractions of explained variance of a principal component are approximately 59.6%, 19.1% and 10.1%, respectively. The first two account for about 78.8%, and the first three for 88.9%. The first direction is dominant but one direction alone loses substantial variation. Retaining two principal components is a plausible descriptive summary: their eigenvalues exceed , whereas the third is below . That cutoff is a heuristic, and the third principal component may still have interpretable content.
The reported coefficient rows are not unit-length vectors. The printed rounded rows have squared lengths , and , consistent with their eigenvalues to the precision of the coefficient table. They are consistent with the scaled principal component loading convention . Such rows remain eigenvectors, but the score direction with unit length is , or more accurately the row divided by its actual Euclidean norm when using rounded entries. Under this convention is the correlation of standardized attribute with the variance-one score for component :This explains both their sizes and why they must not be treated as the unit vectors from parts (i) and (ii).
The first principal component has positive coefficients on every attribute, strongest on friendliness, goodness, niceness, bravery and strength. With the favorable endpoints coded in the positive direction, it describes a broad favorable or impressive evaluation, with a potency contribution. The second contrasts movement and speed, with some size and strength, against the first three evaluative attributes; it is chiefly an activity dimension. The third is dominated by size, with smaller positive strength and negative movement/speed coefficients, distinguishing size or potency from activity. These are interpretations of directions of variation, not evidence of causal latent traits. Reversing a principal component's overall sign changes neither its meaning as an axis nor its explained variance; endpoint coding fixes only how its positive side is described.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 46 3 b iv Solution Created 2026-10-03 Updated 2026-10-14
If the change is purely a rescaling of the physics mark, write , where . The sample covariance matrix transforms asThe physics variance is multiplied by , becoming approximately . Each covariance between physics and another subject is multiplied by , and all other entries stay unchanged. Principal component analysis on this new sample covariance matrix maximizes variance in the new numerical units, so its eigenvectors and explained variance of a principal component generally change. Physics receives disproportionately greater influence simply because its unit has changed.
One solution is to convert the physics marks back to the original scale before doing principal component analysis. Alternatively, use principal component analysis on a correlation matrix: standardize every subject byA positive change of units multiplies both a centered variable and its standard deviation by the same factor. Thus it leaves and the sample correlation matrix unchanged.
Correlation-based principal component analysis is invariant under positive changes of units; covariance-based principal component analysis is not. Standardizing gives each subject unit variance, which is a different weighting choice and can emphasize relatively low-variance subjects. If the revised assessment changes the scores themselves rather than just their units, its sample correlation matrix may also change, and mere standardization cannot recover the original analysis.
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 47 3 c i Solution Created 2026-10-03 Updated 2026-10-14
Covariance-based PCA uses centered protein measurements in their original gram units. Its total variance is . Correlation-based PCA first divides each centered food measurement by its sample standard deviation, giving nine unit-variance variables and total variance nine. Thus it is principal component analysis on a correlation matrix, not an equivalent rotation of the original unscaled measurements.
The variances of cereals and milk together account for of the original total. Consequently those variables have considerable influence on covariance-based PCA. Its first component is dominated by a cereal coefficient opposed to milk , broadly a cereal-versus-milk contrast. Its second is dominated by milk , with cereals and fish . Its third is chiefly white meat versus fish , with a smaller negative milk term. Component signs may all be reversed without changing the analysis; the important features are relative signs and magnitudes.
After standardization, eggs and starch can contribute as strongly as large-variance foods. The first correlation-based component gives positive weight to meat, eggs, milk and starch, opposed principally to cereals and pulses/nuts; eggs now has coefficient despite its small raw variance. The second emphasizes fish and fruit/vegetables negatively, opposed especially to starch and white meat. The third contrasts white meat and fruit/vegetables with milk, fish and red meat. Thus standardization changes both the emphasis and the directions, rather than just the displayed units of the same components.
The explained variance of a principal component must use the appropriate total:Raw and standardized percentages describe different variance objectives and must not be compared as if one method were always superior.
Standardize when relative patterns across variables, rather than their absolute gram-scale variation, should have equal marginal weight. Correlation-based PCA is also insensitive to changing a variable's measurement unit, which covariance-based PCA is not. Here every food group already has the same units, so differing units do not force standardization. If large fluctuations in actual protein amounts are scientifically important, covariance-based PCA is appropriate. If dietary composition across all food groups is the focus, correlation-based PCA can be more informative. Standardization can nevertheless amplify noise in nearly constant variables; the decision should follow the scientific purpose and measurement reliability.
Principal component loading 2026-10-14
Two conventions occur for principal-component loadings: the unit eigenvector defining a principal component, and the scaled vector . For principal component analysis on a correlation matrix, the entries of the latter are the correlations between each standardized variable and the component scaled to variance one. Indeed, and . Thus , whereas ; reporting the convention avoids confusing component directions with correlations.
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.


