ATLAS NOVA My AtlasVelocer ↗

Research methods · Machine learning

Principal component analysis

Principal component analysis (PCA) is a technique for taking a table in which each observation is described by many variables that move together, and replacing those variables with a small number of new ones that are uncorrelated with each other and that capture as much of the variation in the table as possible.

The new variables are called principal components. They are built so that the first component accounts for the largest share of the variance in the data, the second accounts for the largest share of what is left, and so on, each one uncorrelated with the ones before it.⁠[1] The technique is a form of dimension reduction: it makes a wide, tangled table easier to read while giving up as little information as it can.⁠[2]

Key facts
39Impact measures analysed by PCA in Bollen et al. 2009⁠[3]
125Speed-up of flashpca over existing tools, Inouye et al. 2014⁠[4]
26Of 39 ecology analyses overextracting components, Franklin et al. 1995⁠[5]
211,000PBMCs in the CITE-seq immune atlas, Hao et al. 2021⁠[6]

Overview

Principal component analysis

A concrete case makes the shape of the problem clear. Imagine a survey that records, for each of several hundred households, a dozen measurements: income, years of schooling, number of rooms, whether there is a car, and so on. Many of these measurements rise and fall together, so the table carries far less independent information than its twelve columns suggest. PCA re-expresses each household not by twelve numbers but by two, its positions along the first two components, which can then be drawn as points on a flat map. Households that resemble each other land near each other; the map shows the main pattern of difference at a glance. The same manoeuvre applies to spectra, gene expression tables, or recordings from hundreds of neurons at once.

A twelve-column measurement matrix multiplies a two-column loading matrix to produce two score columns and a horizontal elliptical point map.
PCA multiplies centered measurements by data-derived loading weights to obtain component scores. The schematic map displays two uncorrelated score coordinates. View full-size image.From Measurements to Component Scores by Atlas Nova. Illustration generated with AI for this article and checked against its text.

What makes this possible is that the components are not chosen in advance by the analyst. Each one is a linear combination of the original variables, meaning a weighted sum of them, and the weights are determined by the data table itself. The technique is therefore described as adaptive: the new variables are defined by the particular dataset at hand rather than fixed beforehand.⁠[1] Two analysts running PCA on the same table get the same axes; run it on a different table and the axes change. This is also why the method needs no model of what causes what. It is a summary, computed from the numbers, and it will find the directions in which the data spread out most whether or not those directions mean anything in the world.

That last point is where the main cautions lie. A component is a direction of high variance, and high variance is not the same as importance or cause. If one variable happens to be measured on a larger numerical scale than the others, it will dominate the first component for purely arithmetic reasons, which is why variables are usually put on a common scale before the analysis. Even after that, a component can be a blend of several unrelated influences and resist any neat name. The number of components worth keeping is likewise a judgement rather than a fact delivered by the arithmetic; several formal rules exist for deciding, and they do not always agree. These matters of preparation, retention and interpretation are taken up later in the chapter, along with the mechanics of how the components are actually computed.

PCA replaces many correlated variables with a few uncorrelated ones, ordered by how much variation they capture; the axes come from the data, and naming them is an act of interpretation.

History

From least squares to singular values

The singular value decomposition of a matrix, computed by an algorithm of Golub and Reinsch, provides the computational machinery for principal component analysis.⁠[7] The pair of developments is worth holding together, because one supplies the concept and the other supplies the means of calculating it reliably. A review of the method in the control-engineering literature put the point directly, describing principal component analysis as a technique for analysing signals and the singular value decomposition as the computational machinery that serves it.⁠[7]

Gene Golub.
Gene Golub. View full-size image.Genegolub by P. Birken. CC BY 3.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

The arithmetic underneath is the same whichever route is taken. Principal component analysis rests on the eigen-decomposition of positive semi-definite matrices and on the singular value decomposition of rectangular ones; the two are closely related, and a working implementation may use either.⁠[2] In the eigen-decomposition route, one forms a square matrix summarizing how the variables co-vary and solves for its eigenvalues and eigenvectors. Each eigenvector is a direction, each eigenvalue the amount of variance lying along that direction, and the components are simply these directions sorted from largest eigenvalue to smallest. The singular value decomposition reaches the same destination from the data table itself rather than from the covariance matrix.⁠[2]

A later reformulation changed what the technique is, without changing what it computes. Ordinary principal component analysis is not based on a probability model; Tipping and Bishop showed that the principal axes can instead be determined through maximum likelihood estimation of a latent variable model.⁠[8] Each observation is taken to arise from a few unobserved factors plus noise, in a model closely related to factor analysis. They gave an iterative algorithm of the expectation-maximization kind for estimating the principal subspace, and set out the advantages the probabilistic framing conveys.⁠[8]

Tipping and Bishop discuss, with illustrative examples, the advantages conveyed by this probabilistic approach to PCA.⁠[8] It also clarifies what the deterministic version was doing all along: finding the directions that a certain probability model would single out, but without ever stating the model.

The concept and the computation arrived separately: Hotelling's formulation supplied the idea, and the singular value decomposition supplied a stable way to calculate it.

How it works

What the components are and what they are not

The starting point is always a table. Each row is an observation (a household, a sample, a recorded neuron) and each column is a variable measured on it. In the language of the method, the rows are samples and the columns are variables, and the table is the only input the analysis needs. A principal component is a new variable built as a weighted sum of the original columns, with one weight for each column. Those weights are called the loadings. The value an observation takes on a component, obtained by multiplying its original measurements by the weights and adding the results, is called its score on that component. Scores say where each row sits; loadings say what the component is made of.

The components are constructed one after another under two rules. The first component is the weighted sum chosen so that the scores spread out as widely as possible, that is, so that it captures the greatest possible variance in the table among all such sums. The second component must capture the greatest remaining variance, but it is also required to be orthogonal to the first, meaning the two are uncorrelated: knowing an observation's score on one tells nothing about its score on the other. The third is orthogonal to both, and so on down the list.⁠[1] This is what the axes of a principal component analysis are: a series of directions, each at right angles to all the ones before it, each taking the largest share of the variance that is still unclaimed.⁠[9]

A geometric picture helps. If the table had only two columns, the observations would be points scattered on a sheet of paper, and the first component would be the line drawn through the cloud along its longest direction. The second component would be the line at right angles to it. With a dozen columns the cloud lives in twelve-dimensional space, which cannot be drawn, but the arithmetic is the same: the first axis follows the longest stretch of the cloud, the next follows the longest stretch perpendicular to it, and the procedure continues until there are as many axes as columns. Most of the spread is usually concentrated in the first few, which is why a wide table can often be summarized by two or three scores per row.

Because the loadings are computed from the table, the components belong to that particular dataset. Run the analysis on a different set of observations and the weights change; the axes are defined by the data at hand rather than fixed in advance, which is what makes the technique adaptive.⁠[1] This has a consequence that is easy to forget. A component has no existence outside the table it was computed from, and it carries no guarantee that it corresponds to any real quantity in the world. It is a direction in which the numbers happen to spread, and giving it a name is an interpretive act performed by the analyst, not a result delivered by the arithmetic.

Scores, loadings and the biplot

Scores and loadings are best thought of as two views of the same decomposition. The scores form a table with one row per observation and one column per component; the loadings form a table with one row per original variable and one column per component. Multiplying a row of scores by the loadings reconstructs an approximation of that observation's original measurements, and the approximation improves as more components are kept. The first few components therefore give a compressed version of the table, and the size of each component's share of the variance says how much of the original detail that compression preserves.

Both views can be drawn on a single diagram. A biplot places a vector for each row and a vector for each column in the same plane, chosen so that any entry of the table is, to a good approximation, the inner product of the row vector and the column vector that correspond to it.⁠[10] In practice this means the observations appear as points and the variables as arrows radiating from the centre, and the picture can be read in two ways at once: distances between points reflect how similar the observations are, while the directions and lengths of the arrows show which variables drive the separation and how strongly they are correlated with one another. A variable whose arrow points along the first axis is one that contributes heavily to it; two variables whose arrows point the same way rise and fall together in the data.

The biplot is a display, not an extra analysis, and it inherits the limits of the components it draws. Only two axes can be shown at a time, so whatever variance lies in the remaining components is invisible in the picture. The arrows are loadings, and a loading is a weight in a weighted sum, not a measure of how important a variable is in any causal sense. A variable can load strongly on a component simply because it varies a great deal, and a component can mix the contributions of several variables that have nothing to do with one another. The map shows the shape of the table faithfully enough; it does not tell the analyst what the shape means.

A component is a weighted sum of the original variables, defined by the data and ordered by variance; its scores locate the observations and its loadings describe the mixture, but neither carries a meaning on its own.

Components are constructed one after another, each capturing the greatest unclaimed variance.

Preparing the table: scaling, standardization and awkward data

Principal component analysis finds the directions in which a table spreads out most, and it measures spread in the units the numbers happen to be written in. That is the source of its most common practical failure. Suppose a table records, for each of several hundred households, annual income in currency units and the number of rooms in the dwelling. Income varies by tens of thousands, rooms by two or three. The first component will run almost entirely along income, not because income is the more meaningful variable but because its numbers are larger, so its variance is larger in absolute terms. The analysis would be reporting the choice of units rather than any pattern in the households.

Two horizontal streams carry income and room-count values through column statistics and z-score calculations to the same standardized value of one.
Income and room counts are converted to a common scale by subtracting their column means and dividing by their standard deviations. Both illustrative values become one standard deviation above the mean. View full-size image.Standardizing Measurements Before PCA by Atlas Nova. Illustration generated with AI for this article and checked against its text.

The remedy is to put every variable on a common footing before the analysis, a step usually called standardization: subtract each variable's mean and divide by its standard deviation, so that every column has mean zero and variance one. After this, a unit of movement means the same thing in every column, and the components reflect the pattern of correlation among the variables rather than the accident of their scales. Standardization is not a mere preliminary but part of the analysis, since it decides what counts as variation; a general account of the method treats scaling of the data as a topic in its own right, alongside the choice of how many components to keep and how to read them.⁠[11] The choice is not always automatic. The analyst has to decide whether differences in spread are signal or artefact.

When the columns are shares of a whole

Some tables carry a constraint that ordinary standardization does not fix. Compositional data are vectors of proportions, such as the percentages of a rock's chemical makeup or the shares of a household budget spent on different categories, and their defining property is that the components of each vector sum to a constant, usually one or a hundred.⁠[12] This closure, as it is called, creates a spurious negative correlation: if one share goes up, the others must on average go down, simply because the total is fixed. A principal component analysis run on the raw percentages will therefore find a strong first axis that reflects nothing but the constraint, and the covariance structure of such data is strongly biased as a result.⁠[13]

The standard remedy is to transform the data before analysing it. A log-ratio transformation replaces the raw proportions with logarithms of ratios between them, which removes the fixed-sum constraint and opens the data up for ordinary multivariate methods. The centred log-ratio transformation is often used, but the transformed values are not of full rank and so cannot be fed directly to robust variants of the technique; the isometric log-ratio transformation avoids that problem at the cost of variables that are no longer directly interpretable in terms of the original measurements.⁠[13] Either way, the transformation has to be paired with a way of translating the resulting components back into statements about the original shares. The broader lesson is that a table can look perfectly ordinary, with no missing values and no obvious errors, and still violate an assumption the method silently makes.

Discrete and ordinal variables

A third awkwardness arises when the columns are not continuous measurements at all but categories or ordered grades: whether a household owns a bicycle, or a rating on a five-point scale. One procedure in welfare studies is to run the analysis on a set of dummy variables. This is the approach associated with Filmer and Pritchett, whose procedure has been analyzed in welfare studies.⁠[14]

Its statistical properties have been examined directly. A large simulation study compared the dummy-variable procedure with alternatives that respect the discrete nature of the data, either by keeping ordinal variables as single ordered columns rather than splitting them, or by basing the analysis on polychoric correlations, which estimate what the correlation between two underlying continuous variables would be given only their discretized versions. The simulations indicated that the widely used dummy-variable approach can be improved upon by these alternatives, and an empirical example using Bangladesh Demographic and Health Survey data of 2000 was used to show how the procedures differ in practice.⁠[14] The point is not that the familiar approach is wrong, but that collapsing a graded variable into a handful of yes-or-no columns changes the correlation structure the analysis sees, and the change is large enough to matter for the resulting index.

These three preparations share a common logic. Principal component analysis takes the table it is given at face value, so any property of the table that is an artefact of how the numbers were recorded, rather than a feature of what was measured, will be picked up as if it were real structure. Standardizing addresses differences of scale, log-ratio transformation addresses the fixed-sum constraint, and careful handling of discrete variables addresses the distortion introduced by coding. None of these steps is visible in the arithmetic of the components themselves; each is a decision made before the analysis begins, and each shapes what the components turn out to be.

The components can only summarize the table they are handed, so scale, closure and coding have to be settled before the analysis, not interpreted afterwards.

Choosing how many components to keep

A principal component analysis produces as many components as there are columns in the table. Keeping all of them is no reduction at all, and keeping too few throws away structure, so the analyst must decide where to stop. The decision is not settled by the arithmetic. Each component's share of the variance can be read off directly, and a common habit is to keep components until the cumulative share passes some round figure, but this rule has no principled basis: a component that adds little variance may still carry a distinct and useful pattern, and a component that adds a lot may be a blend of noise.

The problem is usually framed as one of separating signal from noise. The later components, by construction, capture small and shrinking amounts of variance, and at some point what they capture is the random scatter of the sample rather than any structure in the population it came from. A stopping rule is a procedure for locating that point. Several have been proposed, and they approach the question from different directions, which is why they do not always agree.

One family of rules looks at the correlations among the variables after the leading components have been removed. The idea is that if a component is real, extracting it should leave the remaining variables less correlated with one another; if it is noise, removing it should change little. A method developed for this purpose computes the matrix of partial correlations, the correlations that remain between pairs of variables once the influence of the others is held fixed, and extracts components until the average squared partial correlation reaches a minimum, at which point no further component is extracted.⁠[15] The stopping point is exact rather than a matter of judgement, and it has a direct operational reading: it is the point beyond which another component no longer reduces the leftover correlation among the variables.

A second family compares the observed components with what pure noise would produce. Parallel analysis generates a random dataset of the same size, the same number of variables and the same number of samples, computes its components, and compares the two sets of eigenvalues. A component from the real data is retained only if its eigenvalue exceeds the corresponding eigenvalue from the random data; anything below that threshold is treated as spurious.⁠[5] The appeal of the method is that the threshold is tailored to the size and shape of the particular table, since a table with many columns and few rows will throw up largish eigenvalues even when there is nothing in it but noise.

The consequences of skipping this step were measured directly. A review of articles using principal component analysis or factor analysis in four ecology journals between 1987 and 1993 found 39 analyses in 22 articles, of which 29 considered no threshold rule, presumably retaining interpretable components. When parallel analysis was applied to those same datasets, 26 of the 39, about two thirds, turned out to have extracted more components than the data supported, a result the authors warn may have led to interpretations of components that were merely noise.⁠[5] The finding is a caution about habit rather than about any one method: retaining components because they can be named is exactly the practice a formal rule is meant to replace.

Ecology PCA analyses by threshold practice. Of the 39 ecology analyses, 29 considered no threshold rule and 26 were later found to have extracted more components than the data supported. From this article: “A review of articles using principal component analysis or factor analysis in four ecology journals between 1987 and 1993 found 39 analyses in 22 articles, of which 29 considered no threshold rule, presumably retaining interpretable components. When parallel analysis was applied to those same datasets, 26 of the 39, about two thirds, turned out to have extracted more components than the data supported, a result the authors warn may have led to interpretations of components that were merely noise.⁠”⁠[5]

A third approach asks how well the components predict data that were not used to compute them. Cross-validation in this setting means setting aside part of the table, computing the components from the rest, and then using those components to predict the held-out entries. The number of components that predicts best is the number to keep. One implementation deletes each row and each column of the data matrix in turn, predicts the removed entries from the remaining components, and uses fast algorithms for updating a singular value decomposition to make the repeated fitting practicable; the method is aimed specifically at the case where the purpose is dimensionality reduction.⁠[16] Because it measures predictive accuracy rather than the size of eigenvalues, it answers a slightly different question from the rules above, and can therefore give a different answer.

A fourth family works from the residuals, the differences between the original observations and their reconstruction from the components retained. If the retained components have captured the systematic part of the table, the residuals should behave like ordinary random error, and a residual that is far larger than the rest marks an observation the model does not fit. Procedures have been worked out for testing the residuals associated with a single observation vector and for an overall test on a group of observations, under the assumption that the underlying covariance matrix is known, a setting the authors note is reasonable in quality-control work where the aim is to detect outliers.⁠[17] The same logic can be turned on the choice of how many components to keep: as long as the residuals still contain structure, a component is being left out.

No single rule settles the number of components; the defensible practice is to apply a formal criterion, such as parallel analysis or cross-validation, rather than to keep whatever components can be given a name.

Worked example

Reading the map: what the axes mean

A principal component analysis returns axes, and the analyst still has to say what they stand for. The usual route is indirect: look at how the original variables arrange themselves along each axis, and propose a reading that accounts for that arrangement. The reading is an argument, not a measurement, and it is strongest when the variables fall into groups that the axis separates cleanly.

A study of scientific impact shows the procedure at work on a question where no single number was trusted. Thirty-nine measures of scholarly impact were assembled: 19 calculated from 2007 Journal Citation Reports citation data, 16 from the MESUR project's log usage data, and 4 published by the Scimago group from Scopus citation data.⁠[3] Each measure ranks journals, so the table held 39 rankings of the same journals. A principal component analysis of those rankings placed the measures on a map, and the positions were then read as dimensions of impact.

The first component separated usage measures from citation measures: a sharply demarcated cluster of all usage measures sat at the positive end, with the Journal Use Probability isolated at the extreme positive end, while most citation measures sat at the negative end.⁠[3] That alone would be a technical distinction between two data sources, so the authors looked for a substantive reading and found one in the exceptions. The Citation Immediacy Index, a citation measure built on same-year citations and so intended as a rapid indicator, sat near the usage cluster rather than with the other citation measures, and two citation betweenness centrality measures did the same.⁠[3] If the axis were merely usage versus citation, those measures had no business being there. Their position suggested instead a contrast between rapid and delayed indicators: usage logs register interest almost immediately, whereas citations accumulate only after publication delays, and the immediacy index is the citation measure that comes closest to that speed. The reading was offered as speculative, and the authors gave supporting reasons for it, including that present usage rates have been shown to predict future citation rates.⁠[3]

The second component separated measures of popularity from measures of prestige. At its negative end sat statistics such as Scimago Total Cites, the Journal Impact Factor and Cites per Document, which record the rate at which a journal indiscriminately receives citations or usage from many sources. At its positive end sat the social network measures, citation PageRank and betweenness centrality, which use the structure of the citation network to express prestige or interdisciplinary reach.⁠[3] Here the argument rests on what the two families of measure compute: one counts arrivals, the other weighs where arrivals come from.

Putting the two axes together gave a four-way reading, and the placement of individual measures could then be checked against it. Most usage-based measures fell in the rapid, prestige quadrant, approximated in this aspect only by two citation betweenness centrality measures. The Scimago Journal Rank, despite being defined explicitly to transfer prestige from one journal to another, sat among the Journal Impact Factor and Cites per Document, which placed it as a delayed, popularity-type measure.⁠[3] A measure's stated purpose and its behaviour on the map can therefore diverge, and the map is what shows the divergence.

The Journal Impact Factor has achieved a dominant position among measures of scientific impact, and its position on the map is notable: it sat at the periphery of the arrangement rather than at its core, in a small cluster of measures that produced rankings removed from the mainstream: the Scimago Journal Rank, the Immediacy Index, Citation Undirected Weighted Closeness Centrality, Scimago Cites per Document and the Impact Factor itself.⁠[3] The authors also computed, for each measure, its mean rank correlation with the other 38, a summary of how well it approximates what all the measures collectively say. The five measures with the lowest mean rank correlations, namely Citation Scimago Journal Rank, Citation Immediacy Index, Citation Undirected Weighted Closeness Centrality, Citation Cites per Document and the Citation Journal Impact Factor, had values indicating they represent the most particular view of scientific impact, while most measures fell between 0.6 and 0.7; the highest value belonged to Usage Closeness Centrality.⁠[3] On this evidence the Impact Factor represents one of the more particular views of impact rather than a consensus one, and the authors concluded that it should be used with caution.

The broader conclusion was that scientific impact is a multidimensional construct that cannot be adequately measured by any single indicator, although some measures are more suitable than others.⁠[3] That conclusion follows from the shape of the map rather than from any one correlation: if a single number captured impact, the 39 rankings would have collapsed onto one axis, with everything else negligible. Instead two axes each separated recognizable families of measures, and the measures that came closest to the general consensus were not the ones in widest use.

Two cautions belong with this example, and both are general. The names given to the axes, rapid versus delayed and popularity versus prestige, are the authors' interpretations of a scatter of points, plausible because the clusters are sharp and the exceptions explicable, but still interpretations rather than quantities the arithmetic produced. And the axes belong to this collection of 39 measures on this set of journals; a different set of measures, or a different year of data, would yield its own axes with their own weights.⁠[3] Neither caution undermines the finding that impact spread along more than one direction. Both bear on how far the labels can be carried beyond the table they came from.

An axis is named by arguing from where the variables fall along it; the argument is strongest when the clusters are clean and the exceptions have a reason, and it remains an interpretation.

The first two components each separated recognizable families of impact measures.

Uses

Genetics: structure, stratification and ancestry

A genotype table is a natural candidate for principal component analysis. Each row is a person, each column a single nucleotide polymorphism (SNP), a position in the genome where individuals differ in the DNA letter they carry, and each entry records which variant that person has. Thousands of people by hundreds of thousands of SNPs is far too wide a table to read directly, but the columns are not independent: variants that sit near one another on a chromosome tend to be inherited together, so the table's real content lies in a much smaller number of directions. PCA projects each sample onto a series of orthogonal axes, each a linear combination of the allele values across the SNPs, with the first axis chosen to explain the greatest possible share of the variance and each later axis the greatest share left over among directions perpendicular to those before it. Plotted on the first two axes, the map is a summary of genetic similarity rather than of any single variant.⁠[9]

A confounding triangle sits beside a genotype-to-PCA workflow and tables of component scores and a tested marker feeding a logistic formula.
Ancestry differences can generate spurious marker associations when cases and controls have different population composition. Genome-wide PCA scores enter an illustrative logistic association model as covariates. View full-size image.PCA Adjustment for Population Stratification by Atlas Nova. Illustration generated with AI for this article and checked against its text.

What such a map means is less obvious than it looks, and the genealogical reading is the clearest way to see why. For SNP data, the position of a sample on the principal components can be predicted from the average coalescent times between pairs of genomes, the expected time back to the most recent common ancestor of two lineages.⁠[9] Two samples whose lineages tend to meet far in the past are genetically distant, and that distance is what the projection reflects. This is a useful result because coalescent times can be worked out analytically under explicit models, so the projection a given history would produce can be derived rather than guessed. It also exposes the method's limits in the same stroke. Any two demographic histories that yield the same average coalescent times will yield the same projections, so PCA cannot tell migration apart from long-standing isolation, and a cline along the first axis can arise from waves of expansion, from recurrent bottlenecks, from admixture, or from an equilibrium model of spatial structure.⁠[9] A pattern that looks like a story about migration may be a story about something else that leaves the same footprint.

Sampling is the second trap. The projections are strongly influenced by uneven sampling, so a group that happens to be over-represented in the table can pull an axis toward itself, and the resulting geometry says as much about who was recruited into the study as about who is related to whom. The same analysis also showed that SNP ascertainment, the bias introduced when the markers were discovered in a small panel, has a largely simple and predictable effect: it tends to scale the projections rather than rearrange them, leaving the relative placing of samples much as it would have been.⁠[9] That is a reassuring result about one kind of distortion and no comfort at all about the other.

Where the history is simple, the projection can be turned into an estimate. In cases of two- or three-way admixture, with populations close to the sources available for sampling, the admixture proportions of an individual can be read from where that individual falls on the axis defined by the source populations. Applying this to 20 African American individuals from the HapMap3 project, with Utah residents of European ancestry and Yoruba from Nigeria standing in for the sources, gave genome-wide African ancestry proportions typically between 70 and 90 percent, while individual chromosomes varied considerably, some appearing essentially European and others essentially African, though no chromosome showed an overall tendency to come from one population.⁠[9] The contrast between the steady genome-wide average and the restless chromosomes is the informative part: it is what the reshuffling of chromosomes each generation would produce.

Correcting for ancestry in association studies

The practical use of these axes is in disease genetics, where ancestry is a nuisance that has to be removed. In a genome-wide association study, the frequencies of markers are compared between people with a disease and people without, and a marker is flagged when the difference is larger than chance would explain. Population stratification is the failure mode: if cases and controls differ systematically in ancestry, then any allele that is more common in one ancestral group than another will differ in frequency between the groups for reasons that have nothing to do with disease, and the study will report a spurious association.

The correction uses the components directly. A method developed for the purpose runs PCA on the genome-wide marker data to model ancestry differences between cases and controls explicitly, then includes the resulting component scores as covariates in the association test. Adjusting for a sample's position on the leading axes absorbs the ancestry difference, and because the adjustment is made marker by marker according to how strongly that marker's frequency varies across ancestral populations, it targets the spurious signal while leaving the power to detect real associations as intact as the design allows. The approach was described as simple and efficient enough to apply to studies with hundreds of thousands of markers.⁠[18] The components here are not the object of interest; they are a compact description of background relatedness, used to subtract it.

Two cautions follow from the earlier discussion and apply directly to this use. The axes are computed from the samples at hand, so they describe the ancestry structure of that particular study, and a component that captures one contrast in one cohort will not mean the same thing in another. And because the axes summarize genetic similarity rather than naming its cause, adjusting for them removes the confounding whatever its source, which is what the analysis needs, without licensing any claim about which populations the samples came from. The components do their job as covariates precisely because nobody has to interpret them.

On genotype data the axes are summaries of average relatedness, so they correct confounding well and explain history poorly.

Neurons, cells and the order of operations

A recording from a population of neurons produces a table of the same shape as any other: one row per time bin or trial, one column per cell, each entry a firing rate. In higher cortical areas the columns are hard to read one at a time, because most cells respond to several features of a task at once, a property called mixed selectivity. A cell may fire more for one stimulus, less for another, and differently again depending on the choice the animal is about to make, so its average response to any single condition is a blend. Averaging over cells that pass some selection criterion throws away much of this fine structure, and reducing the table with ordinary PCA keeps the mixed responses mixed: the components capture variance faithfully but do not say which task parameter any of it belongs to.

Figure 1. Local and global structure kept by PCA and by t-SNE. Scores for two structure-preservation metrics on a synthetic dataset of 15,500 points, comparing the first two principal components with a default t-SNE embedding. The source states: “t-SNE is much better than PCA in preserving the local structure (KNN 0.13 vs. 0.00) but much worse in preserving the global structure (KNC 0.23 vs. 1.00 and CPD 0.51 vs. 0.85)” (Kobak & Berens (2019)).⁠[20]

Demixed principal component analysis (dPCA) was built to address exactly this. It decomposes population activity into a few components that capture almost as much variance as PCA does, but are demixed so that each component is interpretable with respect to the experimentally controlled and monitored task parameters, such as the stimulus, the decision or the reward. The method was demonstrated by reanalysing four published datasets spanning different species, cortical areas and tasks, and in each case a single summary figure made the task-dependent features of the population response visible.⁠[19] The gain is interpretive rather than a matter of squeezing out more variance: the components are arranged so that a reader can see which parameter drives which part of the response, which is what the mixed selectivity had obscured.

The order of operations matters here, and it is the same lesson in a different setting. When a table is destined for a two-dimensional picture, the picture is often drawn by a method that preserves neighbourhoods rather than variance, and the question becomes what to feed it. t-distributed stochastic neighbour embedding (t-SNE) maps high-dimensional points to a plane so that close neighbours stay close, but by construction it cares only about local neighbourhoods, and the relative placement of separate clusters on the finished plot can depend more on random starting positions than on the data. The remedy is to start the embedding from a sensible arrangement rather than a random one: initialising t-SNE with the first two principal components, together with a high learning rate and multi-scale similarity kernels, produced visualisations that preserved the global geometry of the data far better than the default procedure.⁠[20]

The reason is that an informative starting arrangement survives the optimisation, whereas a random one leaves the large-scale layout to chance. The demonstration used published single-cell RNA sequencing datasets with up to two million cells.⁠[20] PCA is not the final picture in that pipeline; it is the first pass that gives the later method somewhere sensible to begin.

The same division of labour appears when the goal is to place new cells onto an existing reference. A multimodal atlas of the immune system was built from a dataset of 211,000 human peripheral blood mononuclear cells, with surface protein panels extending to 228 antibodies, and the atlas defined cell states from RNA and protein measurements jointly. To map a new dataset onto that reference, the authors used a supervised form of principal component analysis to identify the transcriptomic modules that best delineate the cell types already defined in the atlas, and then projected the new data through those modules.⁠[6] Here the components are not sought for their variance; they are sought for their ability to separate known groups, which is what the supervision adds. The reported benefit was improved cell type identification and robust integration of samples from multiple donors and disease states, and the workflow was automated so that a dataset of 50,000 cells could be processed and mapped in under five minutes.⁠[6]

Set side by side, these three uses show PCA occupying different positions in an analysis. In dPCA it is the thing being modified, because the plain version captures variance without respecting the experimenter's parameters. In the t-SNE pipeline it is a preparatory step, supplying a starting layout that the later method would otherwise lack. In the mapping workflow it is supervised, bent toward separating categories the analyst already trusts. What stays constant is that the components are computed from the table in front of them and carry no meaning until someone supplies one. Whether that supply is a task parameter, a cluster label or a reference atlas, it comes from outside the arithmetic.

PCA often works best as a first step rather than a last one: it can seed a later embedding or be constrained by known labels, but the meaning of its components still has to come from somewhere else.

Wealth indices, spectra and other applications

Wealth indices from asset data

Two elongated strips in false-colour blue, cyan, yellow and red, set against a dark blue background.
Two elongated strips in false-colour blue, cyan, yellow and red, set against a dark blue background. View full-size image.Hyperspectral image of "sugar end" potato strips by SortingExpert. CC BY-SA 3.0, via Wikimedia Commons. Scaled to 900 pixels wide; no crop or other changes by Atlas Nova.

Household surveys rarely collect reliable income or consumption figures; accurate measurement of either is expensive, and respondents misreport. What surveys do record cheaply is a list of assets: whether the dwelling has electricity, a radio, a bicycle, a finished floor. Each of these is a yes-or-no or graded item, and none of them alone says much about a household's position. Together they move in step, because households that own one durable good tend to own others. That correlation is what makes the table suitable for principal component analysis, and the first component is then read as a socio-economic status index: a single score per household, built as a weighted sum of the asset items, along which households can be ranked and divided into groups.⁠[21]

The construction has been validated as a way to describe how status is differentiated within a population, but the same review is careful about what the index can and cannot support. The choices made before the analysis matter: which variables go in, how the data are prepared, and how to handle the clustering that arises when many households give identical answers. Interpretation of the resulting scores, and the cut-points used to sort households into status groups, are further decisions that shape the answer.⁠[21] An index built this way orders households relative to one another within the survey at hand; it is a summary of asset ownership, not a measure of income, and its weights belong to that dataset.

Spectra as mixtures of recurring shapes

A spectrum presents the same problem in a different dress. A single measurement records intensity at hundreds or thousands of wavelengths, so one sample is a long row of numbers that no one can read directly, and a set of samples is a wide table whose columns are strongly correlated because neighbouring wavelengths rise and fall together. Principal component analysis reduces this to a few components, and here the components have a concrete reading: each is a recurring, uncorrelated spectral shape, and the observed spectra are built by adding these shapes together in different proportions.⁠[22] The scores play the part of concentrations or weights, saying how much of each underlying shape a given sample contains, while the loadings are the shapes themselves. A component can be pictured as a kind of subtraction spectrum, the difference between the extremes of variation within the dataset, and each successive component refines the fit between the reconstructed spectra and the originals.⁠[22]

The interpretation is only as good as the data behind it. Because the model is derived entirely from the spectra supplied, the shapes it finds depend on the nature of that particular collection, and the chemical meaning of a loading has to be argued from the application rather than assumed from the arithmetic.⁠[22]

Differential sensing, and the case against the black box

A differential sensing array works like a panel of loosely selective receptors: several hosts bind a target with different affinities, and the pattern of responses identifies it, much as the pattern of responses across taste receptors identifies a flavour. The output is a table of responses across hosts, and principal component analysis is a standard way to display it, with discriminant analysis often used alongside to sharpen the separation of known classes. A review of these routines warns that the two methods are sometimes applied as black boxes, and sets out to show what the arithmetic actually does to the data so that the plots can be read correctly. Among the practical questions it takes up are how many hosts an array should contain, when adding another host is worthwhile, how to obtain the most informative plot of a dataset, and when an array is not needed at all.⁠[23] The warning is not that the methods are unsound but that a scatter of points on two axes invites conclusions the analysis has not earned; the axes are chosen for variance, and whether they separate the classes of interest is a separate question that has to be asked deliberately.

Compression and decorrelation in imaging

Hyperspectral imaging gives the same wide table a further twist: each pixel carries a spectrum across many narrow bands, so a scene is a stack of images, one per band, and adjacent bands are highly correlated. Principal component analysis supplies spectral decorrelation, replacing the bands with components that carry the same information in uncorrelated form, and it doubles as spectral dimensionality reduction when only the leading components are kept. One study embedded the technique in a JPEG2000 compression scheme and evaluated it both by rate-distortion performance and by how well information survived in an anomaly-detection task, comparing it against the common alternative of a wavelet transform for decorrelation. The PCA-based coder yielded rate-distortion and information-preservation performance superior to that of the wavelet-based coder, and the best PCA performance occurred when a reduced number of PCs were retained and coded. The authors proposed a linear model for estimating how many components to keep in such a scheme.⁠[24]

That last result is a neat illustration of what the technique is for. Discarding the trailing components costs almost nothing in information and saves a great deal in storage, because those components hold little beyond noise. The saving is real only because the components were ordered by variance in the first place.

In each of these settings the components are a compression of a wide, correlated table; what they mean, whether an asset ranking, a spectral shape or a decorrelated band, is supplied by the subject matter, not by the arithmetic.

Does reducing dimensions help? Evidence and counter-evidence

The appeal of reducing a wide table to a few components rests on an assumption that is easy to state and easy to forget: that the directions carrying the most variance are also the directions that carry the structure an analyst cares about. Variance is a property of the numbers; structure of interest is a property of the question. Where the two coincide, dimension reduction is a gift. Where they part company, the reduction can quietly destroy the very pattern it was meant to reveal.

The sharpest test of this came from gene expression data, where clustering samples or genes into groups is a routine exploratory step and PCA is often run first to shrink the table. A study compared the quality of clusters obtained from the original variables with the quality obtained after projecting the data onto subsets of the principal component axes, using both real and synthetic gene expression datasets.⁠[25] If the leading components captured the grouping, clustering on them should have matched or improved on clustering the raw measurements. It did not. Clustering with the components rather than the original variables did not necessarily improve cluster quality and often degraded it, and the first few components, which by construction hold most of the variation, did not necessarily capture most of the cluster structure. The effect also varied with the clustering algorithm and the similarity metric used, so there was no single correction that rescued the approach; the authors' overall recommendation was against running PCA before clustering except in special circumstances.⁠[25]

The result is worth sitting with, because it is not a claim that PCA computes the wrong answer. The components are exactly what they were defined to be: the orthogonal directions of greatest variance, in descending order. What the gene expression study shows is that a direction of large variance and a direction that separates groups need not be the same direction. A table can vary enormously along an axis that cuts across every cluster, because a few samples are extreme or because one technical factor shifts whole batches, and that axis will be the first component. Meanwhile the contrast that divides one group of samples from another may contribute comparatively little variance and end up in a later component that a routine analysis discards. Keeping the top two components and clustering on them is therefore a bet that variance and grouping align, and the study found that in these data the bet often lost.

Set against this, the demixed variant described earlier looks like a counterexample, and in a limited sense it is. Demixed principal component analysis was built precisely because plain PCA captures variance without regard to the experimenter's parameters, and it constrains the decomposition so that each component depends on as few task parameters as possible while still capturing most of the variance. Across four reanalysed datasets spanning different species, cortical areas and tasks, a single summary figure made the task-dependent features of the population response visible.⁠[19]

That is a success at recovering structure that plain components would have left mixed together. But it is a success achieved by adding information from outside the table, in the form of the known task parameters, and bending the decomposition toward them. It shows that dimension reduction can be made to serve a structure of interest when that structure is specified in advance. It does not show that the unmodified components would have found it on their own, and the gene expression result is a warning about exactly that unmodified case.

The practical lesson is not that dimension reduction is unhelpful but that its help is conditional, and the condition has to be checked rather than assumed. When the purpose is compression, denoising or a first look at a table, the leading components do their job, since they retain the most information in the least space. When the purpose is to find groups, the components are a candidate summary and not a substitute for the question, and the analysis should be run both ways, on the components and on the original variables, to see whether the grouping survives the projection. The gene expression comparison is the clearest demonstration that the two can disagree, and that the disagreement is not a rare edge case but a routine possibility whenever the largest source of variation is something other than the distinction being sought.

A component is the direction of greatest variance, not the direction of greatest interest; when grouping is the goal, the reduction has to be checked against the original variables rather than trusted.

Clustering on leading components did not necessarily improve quality and often degraded it, so the two approaches can disagree.

Common mistakes

Where PCA misleads

The components are computed, not discovered, and most of the trouble in practice comes from forgetting that. A component is a weighted sum of the columns of a particular table, chosen because it spreads the observations as widely as possible. It is a summary of the numbers, and a summary can be accurate and still be read as though it were a cause. When an analyst names the first component "size" or "health" or "ancestry" and then reasons as if that quantity had been measured, the arithmetic has quietly been promoted into a claim about the world. Nothing in the procedure licenses the promotion. The component is a direction in which the data happen to spread, and the name is supplied from outside.

Testing loadings with the wrong table

The same confusion shows up in a narrower, more technical form when analysts ask which variables "significantly" load on a component. A loading is a weight in a weighted sum, and the natural impulse is to test whether it differs from zero. Some analysts do this by looking up the correlation between an original variable and the component scores in standard statistical tables, treating the scores as though they were fixed measurements rather than quantities computed from the same data. Others simply flag any loading larger than an arbitrary cut-off such as 0.50.⁠[26] Both habits mistake a derived quantity for an observed one.

A comparison of the available approaches made the problem concrete. Using simulated data, the authors examined how a range of methods for judging eigenvector coefficients performed in terms of type I error rates and power, across conditions that varied the number of real dimensions in the data, whether variables were unique or complex, the size of the coefficients, and how many variables were associated with a given dimension. Bootstrap confidence intervals, and a modified bootstrap interval based on the broken-stick model, proved the most reliable of the techniques compared.⁠[26] The lesson is that the significance of a loading has to be established by resampling the data and recomputing the whole analysis, because the loading's uncertainty depends on the uncertainty of every other part of the decomposition. A table of critical values cannot supply that.

When the leading components are not the interesting ones

The most consequential misreading is the assumption that the directions of greatest variance are the directions that matter. Variance is a property of the numbers; interest is a property of the question, and the two need not coincide. A batch effect, a handful of extreme samples, or one variable measured on a wide scale can all dominate the first component while the contrast an analyst cares about sits in a later one that a routine analysis discards. The gene expression comparison discussed earlier found that clustering with the principal components instead of the original variables does not necessarily improve, and often degrades, cluster quality, and that the first few components do not necessarily capture most of the cluster structure.⁠[25]

Outliers and the pull of extreme rows

Ordinary principal component analysis is built on squared distances, which means a single unusual observation can exert disproportionate influence on the axes. A row whose values are extreme in several columns at once contributes enormously to the variance, and the first component will rotate toward it, so that the summary describes the outlier rather than the population. The problem compounds because the outlier is often the observation of most interest, and the analysis has effectively hidden it inside a component that appears to describe everyone.

Two responses have been developed. One replaces the squared criterion with an absolute-value one: a variant based on L1-norm maximization is less sensitive to outliers than the conventional L2-norm version, is invariant to rotations, and was shown to find a locally maximal solution, with comparisons against conventional methods on several datasets.⁠[27] The other attacks the problem by separating the table into two parts. Robust principal component analysis supposes that the data matrix is the superposition of a low-rank component and a sparse component, and shows that under suitable assumptions both can be recovered exactly by solving a convex program, Principal Component Pursuit, which minimizes a weighted combination of the nuclear norm and the L1 norm.⁠[28] The low-rank part carries the ordinary structure and the sparse part carries the corruption, so the components are computed from the former. The same work notes that the approach extends to matrices with a fraction of entries missing, and demonstrates applications in video surveillance, where objects are detected against a cluttered background, and in face recognition, where shadows and specularities are removed from images.⁠[28]

Compositional data raise a related hazard that has nothing to do with extreme rows. Because the shares in each vector sum to a fixed total, the covariance structure is strongly biased, and a principal component analysis run on untransformed geochemical data will report structure that is an artefact of the closure. A study of such data argued that PCA should not be carried out without an appropriate transformation, and that a robust approach is preferable when the dataset contains outliers, using an isometric log-ratio transformation together with robust PCA and showing how the resulting scores and loadings can be back-transformed and interpreted in terms of the original variables.⁠[13]

Components that move when the sample moves

A component belongs to the table it was computed from, and a different sample from the same population will produce somewhat different weights. This sampling instability is easy to overlook because the analysis returns a definite answer with no error bars attached. It matters most when the components are given a historical reading. On genotype data the position of a sample can be predicted from average coalescent times, and a cline along the first axis can arise from waves of expansion, from recurrent bottlenecks, from admixture, or from an equilibrium model of spatial structure, so that a pattern resembling a story about migration may be a story about something else with the same footprint. Uneven sampling pulls the axes as well, so the geometry can reflect who was recruited into the study as much as who is related to whom.⁠[9] A map of this kind is a summary of the sample in hand, and reading a demographic history from it is an inference that the projection alone cannot support.

A component is a weighted sum of the columns of one table; its name, its significance and its stability all have to be argued for, and none of them comes with the arithmetic.

Computation at scale

The arithmetic of principal component analysis is settled, but the tables it is asked to handle have grown to a size where the arithmetic has to be organised differently. A single-cell experiment can hold up to millions of cells, and tools have been developed to perform partial PCA on 1 million individuals.⁠[29][20] The classical route computes the full decomposition, returning every component with its eigenvalue and every loading. When only the leading components are wanted, most of that work is wasted, and the waste is what makes large tables impractical.

Seven numbered rows show matrix sampling, orthonormalization, compression, decomposition and scores, beside a disk-to-memory arrow.
Random directions produce a smaller subspace in which a thin singular value decomposition approximates the leading components. The inset shows data chunks moving from disk into memory. View full-size image.Randomized PCA Matrix Algorithm by Atlas Nova. Illustration generated with AI for this article and checked against its text.

A randomized algorithm for the problem exploits this. Rather than solving for the whole decomposition, it draws a small random sample of directions, uses them to find a subspace that is very likely to contain the leading components, and then solves the smaller problem exactly within that subspace. The result is nearly optimal accuracy at a fraction of the cost, and the procedure works well even on parallel processors, unlike the classical deterministic alternatives. The same work adapted the method for data too large to fit in random-access memory, so that the table is read from disk in pieces rather than held whole; the demonstration included a dataset so large that less than a hundredth of it could fit in the computer's memory at once. The method works out-of-core, reading the data from disk in pieces rather than holding it whole in memory.⁠[30]

Genotype data has motivated efficient PCA implementations, since PCA is routinely used to analyze genome-wide SNP data for detecting population structure. flashpca is an implementation built on randomized algorithms that extracts the top principal components with accuracy identical to existing tools but in substantially less time. The reported comparison is concrete: on an Immunochip dataset of 15,000 individuals, flashpca performed the analysis up to 125 times faster than existing tools with identical results, and a run on 150,000 individuals completed in four hours.⁠[4] Its successor, FlashPCA2, extended the approach to partial decompositions, reporting that it can perform partial PCA on 1 million individuals faster than competing approaches while requiring substantially less memory.⁠[29] The saving comes from the same place in both cases: when the full decomposition is not required, the work of computing it can be skipped.

These gains change what is feasible rather than what the components mean. A study that once had to subsample its participants to make the analysis tractable can now use all of them, and the axes it obtains are still summaries of the sample in hand, with all the interpretive cautions that attach to any component. Speed does not settle how many components to keep or what they represent.

On those questions the routine advice is unglamorous and worth stating plainly. None of these steps becomes easier or less necessary when the table is large; if anything, a fast analysis of a huge table makes it more tempting to skip them, since the answer arrives so quickly that the preparation behind it is easy to forget.

Scale changes how the components are computed, not what they are: a fast decomposition of a very large table still needs standardized inputs, a stated retention rule and a cautious reading of its axes.

Detecting outliers and reading residuals: what the discarded components still say

What the discarded components still say

The components that are not kept are usually described as the part of the table that was thrown away. That description is misleading. When an observation is reconstructed from a subset of components, the difference between its original measurements and the reconstruction is called its residual, and the residuals are not empty. They are the portion of each row that the retained components failed to account for. If the kept components have captured the systematic structure of the table, the residuals should look like ordinary random scatter, small and unsystematic. A residual that is far larger than the rest marks a row the summary does not fit, which is exactly what an outlier is.

This turns the leftovers into a diagnostic. Procedures have been worked out for testing the residuals associated with a single observation vector, and for an overall test on a group of observations, under the assumption that the underlying covariance matrix is known. That assumption is a strong one, but it is reasonable in quality-control settings, where a stable process supplies a reference against which each new batch can be checked and unusual observations flagged.⁠[17] The logic is the same one that governs the choice of how many components to keep, run in reverse: as long as the residuals still contain structure, a component is being left out; once they behave like noise, what remains in them is the irregularity of individual rows rather than a missing axis.

The diagnostic has a blind spot, and it is worth naming because it is easy to trust the wrong picture. A small group of observations that are genuinely different from everything else may contribute so little to the total variance that it never shapes the leading components. In single-cell transcriptomics data, a small isolated cluster can fail to appear as isolated on the first two principal components because it has too few cells to contribute much to the explained variance, and a method that preserves only local neighbourhoods can then pull those points into the middle of an unrelated group even when they started on the periphery. The remedy suggested in that setting is to supplement the t-SNE visualisation with an MDS visualisation of cluster means, which is unaffected by the relative abundances of the clusters.⁠[20] The general point is that a row can be an outlier and still be invisible in the components that were kept, so the residuals and the group-level summaries have to be examined alongside the map.

When a few extreme rows do dominate the leading axes, the ordinary fit is the problem rather than the diagnosis. Squared distances let one unusual observation rotate the first component toward itself, so the summary describes the outlier and the rest of the table is compressed into the remaining axes. The robust variants respond at the level of the fitting rather than the inspection: an absolute-value criterion in place of the squared one, or a decomposition that separates a low-rank part from a sparse part and recovers both by solving a convex program, Principal Component Pursuit, minimizing a weighted combination of the nuclear norm and the ℓ1 norm.⁠[28][27] Either way the aim is to keep the axes describing the population, leaving the unusual rows to be found afterwards, in the residuals, where they belong.

The components left out are not nothing: their residuals are where an unusual observation shows itself, provided the analysis has not already let that observation bend the axes.

Alternatives

Sparse, robust and other variants

An ordinary component is a weighted sum of every column in the table, and the weights are almost never exactly zero. A component built from a survey of a dozen household measurements therefore comes back with twelve coefficients, each a small number, and the analyst who wants to say what the component represents has to look at all twelve and decide which ones matter. The difficulty is not that the arithmetic is wrong; it is that a dense list of small weights gives no clean answer to the question of what the component is made of. Thresholding the small coefficients to zero by eye is a common approach, but it is applied after the fact and can be misleading.⁠[31]

Blue and green panels compare four active weighted inputs with two active inputs, alongside loading bar charts and a lasso-type constraint.
Dense and sparse illustrative loading vectors combine standardized variables into different component scores. A sparsity constraint acts during fitting and can exclude variables by assigning zero weight. View full-size image.Dense and Sparse PCA Loadings by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Sparse principal component analysis addresses this by building the sparsity into the fitting rather than imposing it afterwards. The method reformulates the search for a component as a regression-type optimization problem and then constrains the regression coefficients with the lasso (least absolute shrinkage and selection operator) or its elastic-net extension, which penalizes the sum of absolute coefficient values and drives some of them exactly to zero.⁠[32] The result is a modified component whose loadings are sparse: a handful of variables carry nonzero weights and the rest are excluded outright. The same work gives a new formula for computing the total variance of the modified components, and applies the method to both real and simulated data.⁠[32] An earlier variant pursued the same goal by placing a bound on the sum of the absolute values of the coefficients, so that some become zero and the linear function becomes simple enough to interpret.⁠[31] In both cases the result is modified components with sparse loadings, in which some coefficients become exactly zero.⁠[32][31]

When a few rows pull the axes

Conventional PCA is based on the L2-norm, whereas an L1-norm variant is less sensitive to outliers.⁠[27] Two quite different remedies exist. The first keeps the same overall goal but changes the criterion: a variant based on L1-norm maximization replaces the squared criterion with an absolute-value one, which is less sensitive to outliers, is invariant to rotations, and was shown to find a locally maximal solution, with comparisons against conventional methods on several datasets.⁠[27] The second attacks the table itself.

Variables that are not numbers on a line

Standard PCA assumes the columns are quantitative and that the relationships among them are linear. Neither assumption holds when a table mixes nominal categories with ordered ratings, as personality and survey instruments often do. Nonlinear principal components analysis, in the form implemented by the CATPCA program, handles variables that may be nonlinearly related and measured at different levels, including nominal and ordinal data possibly combined with numeric columns, by transforming each variable's categories as part of the fitting. The method is presented as a more flexible alternative to linear PCA, and is particularly suited to nominal and ordinal (e.g., Likert-type) data, possibly combined with numeric data.⁠[33]

Tables that come in layers

Some data arrive not as one table but as a hierarchy of them. The Sleep Heart Health Study recorded each subject's electroencephalographic activity on two visits, yielding two tables per person, and the variation worth separating is of two kinds: how subjects differ from one another, and how each subject's own measurements differ from visit to visit. Multilevel functional principal component analysis was developed for this structure, extracting components that describe variation within subjects and components that describe variation between them, and it was applied to electroencephalographic recordings taken at two visits in the Sleep Heart Health Study, where the resulting components were used to relate sleep activity to cardiovascular outcomes. The method is presented as generally applicable to hierarchical or longitudinal functional data, not only to sleep recordings.⁠[34]

Components and factors

A last distinction is worth drawing because the two techniques are often used interchangeably. Exploratory factor analysis and principal component analysis both reduce a table to a few new variables, but they answer different questions: one seeks the latent constructs that give rise to the observed correlations, the other summarizes the variance actually present in the observed variables. A comparison of the two across nine examples set out their differing objectives and covered standard material alongside more recent developments, noting that in some cases it may be useful to rotate certain principal components when that is appropriate.⁠[35] The difference is not merely philosophical. A study that replicated an earlier comparison of the two methods found that the discrepancy between principal component and common factor pattern loadings is inversely related to the number of indicators per factor rather than to the total number of observed variables, and concluded that principal component analysis should not be used when a researcher wishes to obtain parameters reflecting latent constructs or factors.⁠[36] Where the aim is summary, the components are the right tool; where the aim is a model of what lies behind the measurements, the choice matters.

The variants each relax one assumption of ordinary PCA, and each is worth its cost only when that assumption is the one the data actually violate.

The same idea under other names: correspondence analysis, multiple factor analysis and multiblock data

The variants described so far all keep the same basic shape: one table, rows of observations, columns of quantitative variables. Several established extensions relax that shape while keeping the underlying manoeuvre of replacing correlated columns with a few uncorrelated axes. Their names do not always advertise the connection, which is why a reader who knows PCA can meet correspondence analysis or multiple factor analysis in another field and fail to recognize the family resemblance.

Correspondence analysis (CA) is the generalization of PCA that handles qualitative variables.⁠[2]

Multiple factor analysis (MFA) addresses a different departure: several data tables measured on the same observations.⁠[37] MFA prevents this by a two-step procedure. First it computes a PCA of each table separately and divides every element of that table by the first singular value obtained from its own PCA, which puts the tables on a comparable footing. Then all the normalized tables are aggregated into one grand table and analysed by a PCA that gives a set of factor scores for the observations and loadings for the variables.⁠[37]

The second step yields a single map of the observations, but MFA does not stop there. It also provides, for each table, a set of partial factor scores for the observations, which reflect that table's own viewpoint on each person. A related observation is that the common factor scores could be obtained by replacing each original normalized table with the normalized factor scores from its own PCA, which makes plain how much of each table survives into the joint result.⁠[37]

Exploratory factor analysis seeks the latent constructs that give rise to the observed correlations, while principal component analysis summarizes the variance actually present in the observed variables. The distinction has practical consequences. A study that replicated an earlier comparison found that the discrepancy between principal component and common factor pattern loadings is inversely related to the number of indicators per factor rather than to the total number of observed variables, and concluded that principal component analysis should not be used when a researcher wishes to obtain parameters reflecting latent constructs or factors.⁠[36]

The compositional-data variants discussed earlier belong to the same family, since a log-ratio transformation is likewise a way of adapting the technique to a table whose columns violate an assumption the standard method makes. What unites all of these is that the core operation is unchanged: correlated columns are replaced by a few uncorrelated axes, ordered by the variation they capture, and the axes are defined by the data rather than fixed in advance. What each variant adjusts is the preparation of the table and the meaning attached to distance, so that the same arithmetic can be applied honestly to counts, to several tables at once, or to shares of a whole.

Correspondence analysis and multiple factor analysis are not rival methods but the same reduction applied to tables of a different shape, with the preparation adjusted so that no table or category dominates for purely arithmetic reasons.

Key studies

YearStudySampleDesignFinding
1995Franklin et al.⁠[5]39 analyses in 22 articles published 1987 to 1993review of ecology articles plus parallel analysis of each dataset29 analyses (74.4%) used no threshold rule, and 26 (66.7%) overextracted components according to parallel analysis.
2001Yeung & Ruzzo⁠[25]real and synthetic gene expression data setscomparison of clustering quality before and after projection onto principal componentsClustering with principal components did not necessarily improve quality and often degraded it, and the first few components did not necessarily capture most of the cluster structure.
2003Peres-Neto et al.⁠[26]simulated datasets varying in dimensions, variable types and coefficient sizescomparison of approaches for judging eigenvector coefficient significanceTwo techniques were most reliable in the simulations: bootstrap confidence intervals, and a bootstrap confidence interval adjusted for the broken-stick model.
2006Price et al.⁠[18]method paper on detecting and correcting population stratificationPrincipal components modeled ancestry differences explicitly, minimizing spurious associations while maximizing power to detect true ones.
2006Vyas & Kumaranayake⁠[21]review of how principal component analysis is used to build socioeconomic status indices from asset dataPrincipal component analysis has been validated as a method to describe socioeconomic differentiation within a population, though data issues affect the results.
2009Bollen et al.⁠[3]39 existing and proposed measures of scholarly impactprincipal component analysis of rankings from citation and usage log dataScientific impact emerged as a multi-dimensional construct, and the citation Impact Factor sat at its periphery rather than its core.
2009Kolenikov & Angeles⁠[14]Bangladesh 2000 Demographic and Health Survey data plus a large simulation studysimulation comparing implementations of discrete data principal component analysisRunning principal component analysis on dummy variables can be improved by keeping ordinal variables intact or using polychoric correlations.
2011Candès et al.⁠[28]data matrices that are the sum of a low-rank part and a sparse parttheoretical and algorithmic study of principal component analysis when a data matrix is corruptedBoth parts can be recovered exactly by minimizing a weighted combination of the nuclear norm and the l1 norm, even when a positive fraction of entries are arbitrarily corrupted.
2014Abraham & Inouye⁠[4]benchmark of a randomized principal component implementation against existing toolsOn the Immunochip data, the randomized implementation ran up to 125 times faster than existing tools and returned identical results. It completed an analysis of 150,000 individuals in 4 hours.
2016Kobak et al.⁠[19]four datasets from different species and cortical areas, including 832 neurons from monkey prefrontal cortexreanalysis of neural population recordings with demixed principal component analysisDemixed principal component analysis captured most of the variance while exposing dependence of neural representation on stimuli, decisions and rewards.
2019Kobak & Berens⁠[20]synthetic data of 15,500 points and published single-cell RNA-seq datasetscomparison of dimensionality reduction visualizations with three structure metricst-SNE preserved local structure better than PCA (KNN 0.13 vs. 0.00) but preserved global structure worse (CPD 0.51 vs. 0.85).
2021Hao et al.⁠[6]211,000 human peripheral blood mononuclear cells with panels extending to 228 antibodiesmultimodal single-cell integration using weighted nearest neighbor analysisMultimodal analysis improved resolution of cell states and identified previously unreported lymphoid subpopulations.

See also

References

  1. Jolliffe, I. T., & Cadima, J. (2016). Principal component analysis: a review and recent developments. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 374(2065), 20150202. doi:10.1098/rsta.2015.0202
  2. Abdi, H., & Williams, L. J. (2010). Principal component analysis. WIREs Computational Statistics, 2(4), 433-459. doi:10.1002/wics.101
  3. Bollen, J., Van de Sompel, H., Hagberg, A., & Chute, R. (2009). A Principal Component Analysis of 39 Scientific Impact Measures. PLoS ONE, 4(6), e6022. doi:10.1371/journal.pone.0006022
  4. Abraham, G., & Inouye, M. (2014). Fast Principal Component Analysis of Large-Scale Genome-Wide Data. PLoS ONE, 9(4), e93766. doi:10.1371/journal.pone.0093766
  5. Franklin, S. B., Gibson, D. J., Robertson, P. A., Pohlmann, J. T., & Fralish, J. S. (1995). Parallel Analysis: a method for determining significant principal components. Journal of Vegetation Science, 6(1), 99-106. doi:10.2307/3236261
  6. Hao, Y., Hao, S., Andersen-Nissen, E., Mauck, W. M., Zheng, S., Butler, A., Lee, M. J., Wilk, A. J., Darby, C., Zager, M., Hoffman, P., Stoeckius, M., Papalexi, E., Mimitou, E. P., Jain, J., Srivastava, A., Stuart, T., Fleming, L. M., Yeung, B., & ... Satija, R. (2021). Integrated analysis of multimodal single-cell data. Cell, 184(13), 3573-3587.e29. doi:10.1016/j.cell.2021.04.048
  7. Moore, B. (1981). Principal component analysis in linear systems: Controllability, observability, and model reduction. IEEE Transactions on Automatic Control, 26(1), 17-32. doi:10.1109/tac.1981.1102568
  8. Tipping, M. E., & Bishop, C. M. (1999). Probabilistic Principal Component Analysis. Journal of the Royal Statistical Society Series B: Statistical Methodology, 61(3), 611-622. doi:10.1111/1467-9868.00196
  9. McVean, G. (2009). A Genealogical Interpretation of Principal Components Analysis. PLoS Genetics, 5(10), e1000686. doi:10.1371/journal.pgen.1000686
  10. GABRIEL, K. R. (1971). The biplot graphic display of matrices with application to principal component analysis. Biometrika, 58(3), 453-467. doi:10.1093/biomet/58.3.453
  11. Gewers, F. L., Ferreira, G. R., Arruda, H. F. D., Silva, F. N., Comin, C. H., Amancio, D. R., & Costa, L. D. F. (2022). Principal Component Analysis: A Natural Approach to Data Exploration. ACM Computing Surveys, 54(4), 1-34. doi:10.1145/3447755
  12. AITCHISON, J. (1983). Principal component analysis of compositional data. Biometrika, 70(1), 57-65. doi:10.1093/biomet/70.1.57
  13. Filzmoser, P., Hron, K., & Reimann, C. (2009). Principal component analysis for compositional data with outliers. Environmetrics, 20(6), 621-632. doi:10.1002/env.966
  14. Kolenikov, S., & Angeles, G. (2009). Socioeconomic status measurement with discrete proxy variables: Is principal component analysis a reliable answer? Review of Income and Wealth, 55(1), 128-165. doi:10.1111/j.1475-4991.2008.00309.x
  15. Velicer, W. F. (1976). Determining the Number of Components from the Matrix of Partial Correlations. Psychometrika, 41(3), 321-327. doi:10.1007/bf02293557
  16. Eastment, H. T., & Krzanowski, W. J. (1982). Cross-Validatory Choice of the Number of Components From a Principal Component Analysis. Technometrics, 24(1), 73-77. doi:10.1080/00401706.1982.10487712
  17. Jackson, J. E., & Mudholkar, G. S. (1979). Control Procedures for Residuals Associated With Principal Component Analysis. Technometrics, 21(3), 341-349. doi:10.1080/00401706.1979.10489779
  18. Price, A. L., Patterson, N. J., Plenge, R. M., Weinblatt, M. E., Shadick, N. A., & Reich, D. (2006). Principal components analysis corrects for stratification in genome-wide association studies. Nature Genetics, 38(8), 904-909. doi:10.1038/ng1847
  19. Kobak, D., Brendel, W., Constantinidis, C., Feierstein, C. E., Kepecs, A., Mainen, Z. F., Qi, X. L., Romo, R., Uchida, N., & Machens, C. K. (2016). Demixed principal component analysis of neural population data. eLife, 5. doi:10.7554/elife.10989
  20. Kobak, D., & Berens, P. (2019). The art of using t-SNE for single-cell transcriptomics. Nature Communications, 10(1). doi:10.1038/s41467-019-13056-x
  21. Vyas, S., & Kumaranayake, L. (2006). Constructing socio-economic status indices: how to use principal components analysis. Health Policy and Planning, 21(6), 459-468. doi:10.1093/heapol/czl029
  22. Beattie, J. R., & Esmonde-White, F. W. L. (2021). Exploration of Principal Component Analysis: Deriving Principal Component Analysis Visually Using Spectra. Applied Spectroscopy, 75(4), 361-375. doi:10.1177/0003702820987847
  23. Stewart, S., Ivy, M. A., & Anslyn, E. V. (2014). The use of principal component analysis and discriminant analysis in differential sensing routines. Chem. Soc. Rev., 43(1), 70-84. doi:10.1039/c3cs60183h
  24. Du, Q., & Fowler, J. E. (2007). Hyperspectral Image Compression Using JPEG2000 and Principal Component Analysis. IEEE Geoscience and Remote Sensing Letters, 4(2), 201-205. doi:10.1109/lgrs.2006.888109
  25. Yeung, K. Y., & Ruzzo, W. L. (2001). Principal component analysis for clustering gene expression data. Bioinformatics, 17(9), 763-774. doi:10.1093/bioinformatics/17.9.763
  26. Peres-Neto, P. R., Jackson, D. A., & Somers, K. M. (2003). Giving meaningful interpretation to ordination axes: Assessing loading significance in principal component analysis. Ecology, 84(9), 2347-2363. doi:10.1890/00-0634
  27. Kwak, N. (2008). Principal Component Analysis Based on L1-Norm Maximization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 30(9), 1672-1680. doi:10.1109/tpami.2008.114
  28. Candès, E. J., Li, X., Ma, Y., & Wright, J. (2011). Robust principal component analysis? Journal of the ACM, 58(3), 1-37. doi:10.1145/1970392.1970395
  29. Abraham, G., Qiu, Y., & Inouye, M. (2017). FlashPCA2: principal component analysis of Biobank-scale genotype datasets. Bioinformatics, 33(17), 2776-2778. doi:10.1093/bioinformatics/btx299
  30. Halko, N., Martinsson, P. G., Shkolnisky, Y., & Tygert, M. (2011). An Algorithm for the Principal Component Analysis of Large Data Sets. SIAM Journal on Scientific Computing, 33(5), 2580-2594. doi:10.1137/100804139
  31. Jolliffe, I. T., Trendafilov, N. T., & Uddin, M. (2003). A Modified Principal Component Technique Based on the LASSO. Journal of Computational and Graphical Statistics, 12(3), 531-547. doi:10.1198/1061860032148
  32. Zou, H., Hastie, T., & Tibshirani, R. (2006). Sparse Principal Component Analysis. Journal of Computational and Graphical Statistics, 15(2), 265-286. doi:10.1198/106186006x113430
  33. Linting, M., & van der Kooij, A. (2012). Nonlinear Principal Components Analysis With CATPCA: A Tutorial. Journal of Personality Assessment, 94(1), 12-25. doi:10.1080/00223891.2011.627965
  34. Di, C. Z., Crainiceanu, C. M., Caffo, B. S., & Punjabi, N. M. (2009). Multilevel functional principal component analysis. The Annals of Applied Statistics, 3(1), 458-488. doi:10.1214/08-aoas206
  35. Joliffe, I., & Morgan, B. (1992). Principal component analysis and exploratory factor analysis. Statistical Methods in Medical Research, 1(1), 69-95. doi:10.1177/096228029200100105
  36. Widaman, K. F. (1993). Common Factor Analysis Versus Principal Component Analysis: Differential Bias in Representing Model Parameters? Multivariate Behavioral Research, 28(3), 263-311. doi:10.1207/s15327906mbr2803_1
  37. Abdi, H., Williams, L. J., & Valentin, D. (2013). Multiple factor analysis: principal component analysis for multitable and multiblock data sets. WIREs Computational Statistics, 5(2), 149-179. doi:10.1002/wics.1246

Cite this page: Atlas Nova editors. (2026). Principal component analysis. Atlas Nova. https://velocer.io/atlas/principal-component-analysis/