AI Glossary / Statistics and probability / Intermediate
Correlation matrix
Definition
A correlation matrix is a square table containing the pairwise correlation coefficients among a set of variables. Rows and columns list the same variables in the same order. In an ordinary Pearson correlation matrix for nonconstant variables, the diagonal values are one and the matrix is symmetric. It summarizes linear relationships pair by pair, not causal structure or every possible multivariable relationship.
What it means
When a dataset contains many measurements, a matrix provides a compact overview of which pairs move together and in which direction. A heat map can make broad patterns easier to see, while the numerical table preserves exact values.
The matrix is a collection of related estimates, not independent pieces of evidence. Its meaning depends on the correlation measure, data population, time period, missing-data method, and variable coding. A matrix computed from one customer segment or operating period need not describe another.
How it works
Choose the variables and ensure that their values align across observations. Inspect constant variables, missingness, unusual records, and measurement scales. Decide whether Pearson, Spearman, or another appropriate measure matches the intended question, and document that choice.
For Pearson correlation, standardize the covariance between each pair by the product of their standard deviations. Place the results in the corresponding row and column positions. A variable's correlation with itself is one when its variance is positive; correlation with a constant variable is undefined.
A coherent population Pearson correlation matrix, or the usual matrix computed on the same complete observations, is positive semidefinite. This means no linear combination of the standardized variables has negative variance. Not every symmetric table of numbers between minus one and one with ones on the diagonal satisfies this requirement.
Missing-data handling matters. Pairwise deletion uses different subsets for different pairs and can produce a matrix that is not positive semidefinite. Complete-case analysis uses one common subset but may discard substantial information and can be biased under unsuitable missingness assumptions. Other approaches require their own justified models.
Interpret patterns using plots and domain knowledge. Pairwise coefficients can miss nonlinear dependence and multivariable redundancy. Large collections of correlations also create selection and multiple-testing issues. Before using a matrix in simulation, factor analysis, or another numerical procedure, check that its mathematical properties meet the method's requirements.
Three practical examples
- An AI team reviews pairwise feature relationships before investigating redundancy and data leakage.
- A survey analyst examines how several measured scales relate, while checking coding and missing responses.
- A forecasting team compares correlations among operational indicators and checks whether the relationships persist across time periods.
Think of it this way
Think of a correlation matrix as a relationship directory: each intersection tells you about one pair. The directory is useful for navigation, but it does not describe every group interaction or explain why any relationship exists. Its entries must also fit together as one coherent statistical structure.
Worked example
Take four observations with X = (-1, -1, 1, 1), Y = (-1, 1, -1, 1), and Z = X + Y = (-2, 0, 0, 2). All three means are zero. The squared-value sums are four for X, four for Y, and eight for Z.
The X-Y cross-product sum is zero, so their correlation is zero. The X-Z and Y-Z cross-product sums are each four, so both correlations equal 4/sqrt(4 x 8) = 1/sqrt(2), approximately 0.7071.
With rows and columns ordered X, Y, Z, the matrix rows are (1, 0, 0.7071), (0, 1, 0.7071), and (0.7071, 0.7071, 1), with the displayed off-diagonal values rounded.
No pair has correlation one, yet Z is an exact linear combination of X and Y. The exact matrix is singular, with determinant zero; it is positive semidefinite rather than positive definite. This demonstrates why screening only for near-perfect pairwise correlations cannot detect all linear redundancy.
A numerical determinant calculated from rounded entries may differ slightly from zero. Use full precision when checking the structure. The example establishes an algebraic relationship in these observations, not evidence about an external population or a causal relationship among variables.
Illustrative case study
Fictional case: Hazel Analytics builds a heat map of customer metrics and finds several strong relationships. Before removing features, the team checks whether some measurements are calculated from others and whether missing data differ across pairs.
One proposed input combines two existing inputs exactly, even though neither pairwise coefficient is close to one. Another apparent pattern is driven by a small subgroup. The team documents the matrix's sample counts and investigates the underlying variables. The heat map becomes an entry point for model review rather than an automatic feature-selection rule.
Common misconceptions and mistakes
A correlation matrix is not a covariance matrix: covariance retains units, while ordinary correlation standardizes them. Zero pairwise correlations do not generally imply mutual independence. High correlation does not prove duplication, causation, or interchangeability. Pairwise deletion can produce mathematically incompatible entries, and a visually appealing heat map can conceal tiny sample sizes or missing-value differences. Exact linear dependencies can exist without any single extreme pairwise coefficient.
Business use
Correlation matrices help teams organize exploratory analysis and review the inputs to statistical or AI models. Provide variable definitions, sample counts, method, and missing-data treatment. Investigate actionable patterns with scatter plots, multivariable diagnostics, and validation. If the matrix will feed another algorithm, retain full precision and verify positive semidefiniteness or stronger requirements instead of relying only on a formatted report.
People also ask
Why is the matrix symmetric?
The ordinary correlation of X with Y equals the correlation of Y with X.
Why might a diagonal entry be missing?
A constant variable or insufficient usable observations can make correlation undefined.
Does a positive semidefinite matrix have to be invertible?
No. Singular matrices, including the worked example, can be valid correlation matrices.
Check your understanding
What is the X-Y correlation in the example?
Answer: Zero.
Why is the matrix singular?
Answer: Z equals X plus Y exactly.
Can pairwise deletion always be assumed to produce a coherent correlation matrix?
Answer: No; using different observation subsets can violate positive semidefiniteness.
Related terms
- Correlation coefficient
- Covariance matrix
- Multicollinearity
- Scatterplot matrix
- Singular matrix
- positive semidefinite matrix
- pairwise deletion
- feature redundancy
Learn next
Compare a correlation matrix with its scatterplot matrix and per-pair sample counts. Then examine eigenvalues, exact linear dependencies, and the consequences of different missing-data strategies for downstream analysis.
More in Statistics and probability
- Correlation - Correlation describes a statistical association between variables, often summarized by a coefficient indicating its direction and strength.
- Correlation does not imply causation - Correlation does not imply causation means that an observed statistical association, by itself, does not establish that changing one variable would change...
- Correlation function - A correlation function describes how a statistical relationship varies across pairs of times, locations, or other index values.
- Correlational measures - Correlational measures are statistics that summarize the degree and, where defined, direction of association between variables.
- Count data - Count data record how many events, objects, or observations occur within a defined unit, category, period, or amount of exposure.
- Counterbalancing - Counterbalancing is the planned distribution of condition orders across participants or trials to reduce confounding between experimental conditions and...
Sources
Makridakis, Wheelwright and Hyndman, Glossary of Forecasting Terms, correlation matrix: https://robjhyndman.com/mwh3/FG4.pdf R stats documentation, Correlation, Variance and Covariance (Matrices): https://stat.ethz.ch/R-manual/R-devel/library/stats/html/cor.html
Previous: Correlation function Next: Correlational measures