Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Shared causes versus individual noise
Imagine eight sensors, four driven by engine temperature and four by vibration, each with its own amount of measurement noise. Factor analysis asks what hidden factors explain what the variables have in common. It splits each variable’s variance into two parts:
- the part due to shared factors (communality);
- the part that is the variable’s own noise (uniqueness).
PCA lumps them together, so a very noisy sensor can look important to PCA. Factor analysis knows it’s just noisy.
Sensors differ in precision. A model that treats all noise as equal will chase the noisiest channel. Factor analysis gives honest estimates of shared structure and of each sensor’s noise level, which supports sensor validation, latent health indicators and data fusion. It is also the origin of latent-variable models used in psychometrics and human-factors research.
- 1. A variable's uniqueness is…
- 2. Factor analysis differs from PCA mainly by…
- 3. With very unequal noise, PCA tends to…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Communalities and the model covariance by hand
Model. x = Λz + μ + ε, with z ~ N(0, I) and ε ~ N(0, Ψ), Ψ diagonal. Then Cov(x) = ΛΛᵀ + Ψ.
Communality of variable j is the sum of its squared loadings. Loadings (0.6, 0) give 0.36; (0.6, 0.8) give 0.36 + 0.64 = 1.0.
Model covariance. With Λ = (0.8, 0.6)ᵀ and Ψ = diag(0.36, 0.64):
- the diagonal entries are 0.64 + 0.36 = 1 and 0.36 + 0.64 = 1;
- the off-diagonal entry is 0.8 × 0.6 = 0.48.
Standardised variables. Uniqueness = 1 − communality. A loading of 0.9 leaves uniqueness 0.19.
Parameter count. dq − q(q − 1)/2 loadings (after removing rotational freedom) plus d uniquenesses. For d = 8, q = 2: 16 − 1 + 8 = 23. The covariance has d(d + 1)/2 = 36 entries, so the model is identifiable and testable here.
The steps in plain English:
- Choose the number of factors q (scree, parallel analysis, likelihood ratio, BIC).
- Fit Λ and Ψ by maximum likelihood (EM, or direct optimisation).
- Rotate the loadings (varimax or oblique) for interpretability; the fit is unchanged.
- Interpret factors from their high loadings. Compute factor scores (posterior means) if needed.
- 1. Communality for loadings (0.3, 0.4)?
- 2. Uniqueness of a standardised variable with communality 0.64?
- 3. Off-diagonal model covariance for loadings 0.5 and 0.4 on one factor?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.Fitting, rotating and comparing with PCA
EM for factor analysis (Rubin and Thayer, 1982).
- E-step: β = Λᵀ(ΛΛᵀ + Ψ)⁻¹, so E[z | x] = β(x − μ) and E[zzᵀ | x] = I − βΛ + β(x − μ)(x − μ)ᵀβᵀ.
- M-step: Λ = Sβᵀ(I − βΛ + βSβᵀ)⁻¹ and Ψ = diag(S − ΛβS).
Exercise 1 had 8 variables, 2 factors and noise variances from 0.1 to 0.8. EM recovered every uniqueness within 0.04 and every communality within 0.05.
Rotation. If Λ fits, so does ΛR for any orthogonal R. Varimax chooses R to maximise the variance of squared loadings within each factor, pushing loadings toward 0 or ±1. That gives simple structure: each variable loads mainly on one factor. Exercise 1’s varimax rotation restored the true two-block pattern. Oblique rotations (promax, oblimin) allow correlated factors.
Scale equivariance. Rescaling the variables x → Dx just rescales the loadings and uniquenesses (Λ → DΛ, Ψ → D²Ψ). The fitted model is the same. PCA has no such property: its components change with units.
FA versus PCA. With equal noise variances, FA and PPCA coincide. With unequal noise, PCA tilts toward noisy variables. In exercise 2, at a 64× max/min noise ratio, PCA’s subspace error was 0.43 against 0.10 for FA. Standardising before PCA helped partly (0.14), but it divides by each variable’s total variance rather than its noise.
Heywood cases. Sometimes ML drives a uniqueness to zero or below, meaning a variable explained “perfectly”. That signals too many factors, too little data, or misspecification. Implementations clamp Ψ at a small positive floor.
from sklearn.decomposition import FactorAnalysis
fa = FactorAnalysis(n_components=2, rotation="varimax").fit(X)
fa.components_.T # loadings Λ (d × q)
fa.noise_variance_ # uniquenesses Ψ
Z = fa.transform(X) # factor scores (posterior means)- 1. Varimax rotation aims for…
- 2. If variables are rescaled, FA loadings…
- 3. A Heywood case is…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Identifiability. ΛΛᵀ + Ψ determines Λ only up to rotation, and determines Ψ only if each factor has at least three variables loading on it, or similar conditions; Anderson and Rubin give conditions. The degrees of freedom of the model’s likelihood-ratio test are [(d − q)² − (d + q)]/2. That must be non-negative for the model to be testable, which limits q for given d.
Choosing q.
- Likelihood-ratio χ² tests (over-sensitive with large n).
- BIC.
- Parallel analysis (Horn’s procedure originated for factor analysis).
- Interpretability.
Factor scores. Factors are latent, so scores are only estimates.
- Regression (Thomson) scores are posterior means E[z | x]. They are shrunk toward 0.
- Bartlett scores are weighted least-squares estimates. They are unbiased but noisier.
For one factor with loadings (1, 1), Ψ = I and x = (1, 1), the regression score is 2/3 rather than 1.
Interview questions.
- PCA or factor analysis? PCA for data compression and decorrelation. Factor analysis when you believe in latent causes and want shared variance separated from variable-specific noise, especially with heterogeneous measurement error.
- Why rotate? To get interpretable loadings, since the fit is identical for every rotation. Report which rotation you used.
- 1. Model degrees of freedom for d = 6, q = 2?
- 2. Regression factor scores are…
- 3. Parallel analysis was introduced for…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.When does unequal noise mislead PCA?
History.
- C. Spearman (1904) proposed a single general factor for test scores.
- L. Thurstone (1930s) developed multiple-factor analysis and simple structure.
- D. Lawley (1940) introduced maximum-likelihood factor analysis.
- H. Kaiser (1958) proposed varimax.
- D. Rubin and D. Thayer (1982) gave the EM algorithm.
Exercise 2. d = 12 variables, 2 factors with dense random loadings, n = 300, noise variances spread so that the noisiest is “ratio” times the cleanest (geometric mean 0.5), 4 datasets. Values are sin of the largest angle between the estimated and true loading subspaces.
| noise ratio | factor analysis | PCA / PPCA | PCA on standardised data |
|---|---|---|---|
| 1× | 0.076 | 0.074 | 0.104 |
| 4× | 0.064 | 0.092 | 0.109 |
| 16× | 0.079 | 0.225 | 0.129 |
| 64× | 0.095 | 0.434 | 0.138 |
- With equal noise, FA and PCA were equally accurate. That is the PPCA special case.
- As noise became unequal, PCA’s error grew sixfold, while FA’s barely moved. PCA’s largest-variance directions were pulled toward the noisiest variables.
- Standardising first helped but didn’t fix it, because it scales by total variance, not noise. Only modelling per-variable noise does.
Factor analysis in AI, robotics and aerospace
- Sensor validation: estimated uniquenesses flag channels whose noise has grown.
- Latent health indicators: a few factors summarising many correlated degradation signals.
- Human-factors and workload studies: classic psychometric factor models for questionnaires and physiological measures.
References
- D. B. Rubin, D. T. Thayer (1982). “EM algorithms for ML factor analysis.” Psychometrika 47(1).
- D. N. Lawley, A. E. Maxwell (1971). Factor Analysis as a Statistical Method, 2nd ed. Butterworths.
- H. F. Kaiser (1958). “The varimax criterion for analytic rotation in factor analysis.” Psychometrika 23.
- T. W. Anderson, H. Rubin (1956). “Statistical inference in factor analysis.” Proc. 3rd Berkeley Symposium 5.
- scikit-learn developers. “FactorAnalysis.” Documentation.