Compare ordered PCA eigenvalues with rank-matched noise simulations, reproduce a five-variable example, and understand null-model and retention limits.
Horn parallel analysis
Horn parallel analysis selects principal components or factors by comparing their ordered strengths with those produced by a chosen noise-only reference. In a quant risk panel, it asks how many apparent common directions are stronger than sampling noise alone would typically produce. The answer depends on what counts as noise.
Even independent variables acquire sample correlations. Their largest sample eigenvalue can exceed one simply because the leading direction was chosen to explain as much sample variance as possible. Horn's original contribution was to account for this sampling effect using generated random variables. His 1965 abstract states that rationale.
Start with an n×p panel: observations in rows, variables in columns. Centre each column and divide by its sample standard deviation, calculated with divisor n−1. If Z is the resulting matrix, analyse the sample correlation matrix
R=n−1Z⊤Z,λ1≥λ2≥⋯≥λp.
For each of B simulated panels, generate n×p independent standard-normal observations, repeat the same centring and scaling, and sort its correlation eigenvalues in descending order. At rank j, calculate
qj=Q0.95(λj(1),…,λj(B)).
Compare the largest observed eigenvalue with the simulated largest eigenvalues, the second with the simulated seconds, and so on. The strict passing rule is λj>qj; equality fails. Here the retained model uses the leading consecutive passing components, stopping at the first failure. Reporting that convention matters if an unusual spectrum crosses its reference more than once. Dobriban describes this rank-matched, sequential convention for permutation parallel analysis in §1.2.
The null and observed analyses must match: thresholds from correlation PCA cannot simply be applied to covariance eigenvalues measured in return-squared units. A common-factor analysis version also requires its own extraction and communality choices; the calculation below does not estimate common factors that way.
Five variables, one retained component
Take 100 observations and five variables. Stipulate the observed correlation eigenvalues as (2,1.2,0.9,0.6,0.3); these are an illustrative spectrum, not estimates from a market dataset. They sum to five, as correlation eigenvalues must.
Generate 500 IID Gaussian null panels, using NumPy default_rng(42). Use separate sample means and standard deviations in every panel and column, then take each rank's 95th percentile with NumPy's method="linear". This quantile convention interpolates between adjacent ordered simulation results. The NumPy reference specifies the interpolation.
Component rank
Observed eigenvalue
Simulated 95th percentile
Strict comparison
1
2.0000000
1.4148594
Pass
2
1.2000000
1.2098315
Fail
3
0.9000000
1.0551083
Fail
4
0.6000000
0.9453020
Fail
5
0.3000000
0.8346507
Fail
Retain one component under this convention. A rule that retained every eigenvalue above one would retain two here. Parallel analysis changes that answer because the second-largest noise eigenvalue also tends to exceed one.
Stipulated observed eigenvalues 2, 1.2, 0.9, 0.6 and 0.3 are compared with rankwise simulated 95th percentiles 1.4148594, 1.2098315, 1.0551083, 0.9453020 and 0.8346507. Only rank 1 passes.
Original illustrative comparison: a stipulated observed spectrum against 500 simulated IID Gaussian correlation matrices with 100 rows and five columns. Dashed squares mark the separate threshold at each rank.
These are finite-simulation, rank-specific cutoffs. Comparing every observed rank with one upper edge from the Marchenko–Pastur law would be a different procedure.
What the retained count does—and does not—say
The decision is conditional on the reference model. Independent Gaussian simulations remove cross-variable structure and serial dependence. If financial observations contain serial dependence or changing volatility, these simulations may misrepresent their noise spectrum. Independently permuting entries within each observed column preserves its empirical marginal distribution but destroys its time ordering; it does not automatically solve that problem. A dependence-preserving null needs an explicit design and justification. Dobriban's theory for the permutation version rests on assumptions about the noise and signal, rather than covering every financial panel. See §2.1 and §4.1.
The simulated percentiles also have Monte Carlo uncertainty. Rank 2 misses its cutoff by only about 0.00983 here. A fixed seed makes this run reproducible; it does not make that cutoff exact. More replications and checks across independent seeds can reveal whether a near-boundary retention decision is stable.
Finally, rankwise 95th-percentile comparisons are not a global test with a guaranteed 5% familywise error rate. Nor does a passing component establish a priced risk factor, a useful forecast or a stable economic interpretation. Assess those downstream claims separately.
For the underlying compression problem, PCA and Factor Compression connects covariance eigenpairs, explained variance and reconstruction error. The public page is a preview; the full lesson requires membership.
Revelle, W., fa.parallel documentation, arguments fa, sim, quant and SMC, and Details. The accessed page identifies itself as psych 1.9.11; it documents methodological variants rather than the numerical output above.
Dobriban, E., Permutation methods for factor analysis and PCA, author preprint, §§1.2, 2.1 and 4.1; published in Annals of Statistics 48(5), 2824–2847 (2020). Its permutation-based procedure and guarantees differ from the Gaussian simulation fixture here.
NumPy Developers, numpy.quantile, method parameter and Notes, linear interpolation definition.