For a real random vector with finite second moments, its covariance matrix collects all pairwise covariances:
The diagonal entries are variances. The covariance matrix is a symmetric matrix and a positive semidefinite matrix, because for every real vector ,
Thus one matrix describes the variance of every linear combination of the coordinates. It is a positive-definite matrix exactly when no nonzero linear combination is constant almost surely. A deterministic linear relation produces a zero eigenvalue.
For example,
has unit coordinate variances, covariance , and eigenvalues and . Its unit eigenvectors and describe directions of greatest and least projected variance. For a unit vector , direct multiplication gives : the variation in the sum direction is nine times that in the difference direction.
Figure 1.
A covariance matrix encodes projected variance in every direction
. Left: the covariance ellipse has a semi-major axis of length and a semi-minor axis of length along the eigenvectors of . Right: the variance of the unit-direction projection is . This is exact matrix geometry for the stipulated covariance matrix, with no sampled observations or claimed probability coverage. Details.
The spectral theorem supplies an orthonormal basis of these directions. This connects covariance matrices to principal component analysis: its leading eigenvector identifies the unit-direction projection with the largest variance. For a linear transformation , the transformed random vector has covariance matrix , so uncertainties propagate through a linear model by matrix multiplication.
Every real symmetric matrix satisfying for every real vector is the covariance matrix of a random vector taking only finitely many values. The stated inequality means that is a positive semidefinite matrix. One does not need a multivariate normal distribution to realize a specified second-moment geometry. Conversely, a proposed covariance matrix must be positive semidefinite, since is the variance of the projection onto any real vector .
Here is an explicit construction. If is the matrix rank of , orthogonal diagonalization gives a real matrix with
Let be independent Rademacher random variables, each equal to or with probability , and put . Then and , so
The random vector has at most possible values. Adding any constant vector prescribes its mean without changing its covariance matrix. If , the constant vector alone suffices.
For an original two-dimensional example choose
The four equally likely values of are
Their coordinate means vanish. Their squared first coordinates average to , their squared second coordinates to , and their coordinate products to . The displayed covariance matrix is therefore realized exactly, without sampling error or an asymptotic argument.
These four values are a complete probability model with masses , not automatically an independent random sample whose population is unknown. Applying the usual divisor-three sample covariance matrix to the same four rows would give . NIST explicitly distinguishes that unbiased sample formula with divisor ; probability-weighted population moments use the assigned masses instead.[ref]
The sign construction need not minimize the number of points. If a distribution has positive-mass support points, the centered points obey one nontrivial weighted relation, so their span has dimension at most . Its covariance matrix consequently has matrix rank at most , requiring when . Matching a covariance matrix also does not match the full probability distribution: this finite model and a continuous Gaussian model can have identical means and covariances while assigning very different probabilities to nonlinear events.
For real random vectors and with finite second moments, their cross-covariance matrix collects the covariances between the two sets of coordinates:
It has size , and exchanging the two vectors transposes it: . Unlike a covariance matrix of a vector with itself, a cross-covariance matrix need not be square or symmetric.
For an original construction, let centered independent random variables have variances1and4, and put
Linearity of covariance gives
The second entry contains a negative contribution from , although the total is positive. Also and
This joint covariance matrix is positive semidefinite. That restriction couples its diagonal and off-diagonal blocks; an arbitrary rectangular matrix cannot be combined with arbitrary within-vector covariances to produce a valid joint model.
For fixed real matrices and constant vectors , direct substitution into the definition gives
This identity propagates shared input fluctuations through two different linear readouts, for example when assessing shared calibration error.
From independent identically distributed paired observations, the usual unbiased estimate is
The pairing must be preserved: independently shuffling the second set changes the estimated association. NIST's multivariate tutorial gives the coordinate sample-covariance formula and its assembly into a covariance matrix; the rectangular formula above is the block joining the two chosen coordinate groups.[ref]
For a two-dimensional positive-definite covariance matrix , the centered covariance ellipse is the image of the unit circle under its positive definite square root of a matrix. Equivalently, it satisfies . Its semi-major and semi-minor axes have lengths given by the square roots of the larger and smaller eigenvalues, along the corresponding eigenvectors. The ellipse encodes a second-moment geometry; a probability-coverage interpretation needs additional information about the probability distribution and the chosen scale.
For a random vector with covariance and positive coordinate variances, let . Its correlation matrix is the covariance of , so it is positive semidefinite with unit diagonal. Each entry is the correlation of the corresponding pair of variables. In particular , explaining why an eigenvalue in correlation-based principal component analysis represents that eigenvalue divided by of the total variance. The empirical version is the sample correlation matrix.
For variables with unit variances and common pairwise correlation , the equicorrelation covariance matrix is
On the constant-vector direction, has eigenvalue ; on its orthogonal complement, it has eigenvalue zero. Hence the eigenvalues of are and , the latter with multiplicity . Positive semidefiniteness is therefore equivalent to
At , the matrix has matrix rank one. At , the constant direction has zero variance and the matrix has matrix rank . In the interior it is positive-definite. For , the first population principal component is the normalized sum of the centered variables; for , the largest eigenvalue instead occurs on the orthogonal complement.
The dimension restriction matters. For , the formula gives for every , so the lower bound involving does not apply: there is no distinct variable pair whose correlation could determine .
For a positive-definite covariance matrix, this is Euclidean distance after whitening. It accounts for both scales and correlations and is invariant under consistent nonsingular linear changes of coordinates. Estimating the covariance can be unstable with small samples, and a singular covariance requires restricting to a nonsingular subspace rather than claiming an ordinary metric on the full space.
A compound-symmetry covariance matrix has common diagonal and off-diagonal entries:
For group size , contrasts orthogonal to have eigenvalue , with multiplicity , while the constant direction has eigenvalue . Thus positive semidefiniteness requires exactly and . Negative is allowed down to .
When , a shared random intercept of variance plus independent individual errors of variance realizes the matrix. The group sample mean has variance . The difference between means of two disjoint subgroups of sizes has variance : their common covariance contribution cancels.
For , there is no contrast subspace. The sole eigenvalue is , so only is required. For example, still gives the valid one-dimensional covariance matrix , showing why the two-inequality statement needs .
For a unit vector and , a rank-one covariance spike is the covariance matrix . Its eigenvalue is in the direction and one on the orthogonal complement. It arises by adding an independent scalar normal distribution signal to a standard Gaussian random vector.
For observations , the sample mean and empirical covariance matrix describe average location and joint variation:
Each summand is an outer product, so is positive semidefinite. If the observations are independent and identically distributed random variables with covariance matrix , then . For , replacing the divisor by gives an unbiased estimator.
For the three observations , the sample mean is . The sum of centered outer products is
so the -divisor sample covariance matrix is , and the version is . Stating the divisor avoids ambiguity when comparing formulas. The rank of a centered sample covariance matrix also explains why too few observations force singularity in high dimension.
The uncentered empirical second-moment matrix averages the outer products of the observations. Its expected value is . It is an unbiased estimator of the covariance matrix when the population expected value is known to be zero. It differs from a sample covariance matrix centered at the sample mean.
For observations with , the sample mean is . It is a statistic summarizing location: values give . For an IID sample with mean and finite variance , linearity of expectation gives , while variance additivity for independent random variables gives . Dependence changes the variance through cross-covariances. A sample mean is sensitive to extreme observations, and a population such as the Cauchy distribution need not have the finite mean needed for ordinary averaging guarantees.
For independent samples of sizes from populations with means and finite variances , the difference of their sample means has expected value and variance . This uses independence between and within the samples. With dependent samples, a covariance term is required instead.
Partition a sample into two disjoint groups with fixed positive sizes , and let . The overall sample mean is the weighted mean
Subtracting gives the displayed identity. The subgroup and overall sample means share observations, so they are not independent. If the two disjoint groups are sampled independently, then
Thus treating the subgroup and the combined sample as two independent samples uses the wrong standard error. Equality of the subgroup and overall population means is equivalent to equality of subgroup and complement means when both groups have positive weight, but the sampling distribution must respect the shared observations.
For independent and identically distributed observations with finite positive variance, the central limit theorem, consistency of the sample variance and Slutsky's theorem give . Under an independent normal distribution sample it instead has the exact finite-sample Student t-distribution with degrees of freedom, as described by the studentized normal sample mean. The asymptotic statement does not require normal individual observations.
For observations , the sample covariance matrix is , or the same sum divided by under the unbiased convention.
If and , then . In particular full column rank of raw does not ensure a nonsingular centered sample covariance matrix. When is singular, its Gaussian precision profile likelihood has no finite maximizer: increase precision along a nonzero null vector.
For paired scalar observations , their sample covariance is , or the same sum divided by under the unbiased convention. It is an off-diagonal entry of the sample covariance matrix of the paired vectors.
For a nonzero positive semidefinite covariance matrix , its covariance effective rank is
where the operator norm is induced by Euclidean norm and the are the nonnegative eigenvalues. Each nonzero eigenvalue contributes at most one to this ratio, so
A scalar multiple of has covariance effective rank , while a matrix with and a unit vector has covariance effective rank one. For , the ratio is , although the ordinary matrix rank is three.
Thus the quantity measures total variance relative to the largest directional variance, rather than merely counting nonzero directions. Multiplying by a positive scalar leaves the ratio unchanged. Its role in the Gaussian sample-covariance operator-norm bound makes it a useful measure of the dimension that matters for covariance estimation. The zero matrix requires a separate convention because the displayed ratio is .
Let be independent centered Gaussian random vectors with common nonzero covariance matrix , and put . There is a universal constant such that for , with probability at least ,
where is the effective rank of a covariance matrix.
The bound combines an expected operator norm error with Gaussian concentration inequality. In Euclidean space, the Gaussian effective-dimension parameter in the primary result is comparable to this trace ratio; replacing maxima by sums gives the displayed version.[ref]
For , the covariance effective rank is , and relative error is controlled by . covariance concentrated in fewer directions can have much smaller covariance effective rank. The estimator here is the uncentered empirical second moment for a known zero mean; an unknown mean and empirical centering require the corresponding formulation. The bound remains meaningful when is singular but nonzero, since it does not invert .
The precision matrix is the inverse of a nonsingular covariance matrix. For a multivariate normal distribution, a zero off-diagonal precision entry encodes conditional independence of the corresponding coordinates given all remaining coordinates.
For a nonsingular multivariate normal distribution with precision matrix , fixing all coordinates except leaves a density proportional to after completing the square. Thus its conditional variance is the reciprocal diagonal precision entry. This is conditioning on every other coordinate, not the marginal variance .
In a Gaussian graphical model, regressing component on the others gives the displayed coefficients, residual variance and intercept . Opposite directions have identical zero patterns and signs because is symmetric with positive diagonal, but generally unequal coefficient magnitudes.
For independent multivariate normal observations with unknown mean and nonsingular covariance, profiling the mean at its sample value gives negative log-likelihood proportional to over . The sample covariance matrix uses divisor . Its minimizer exists exactly when , and is then .
If a positive-definite matrix is the precision matrix of a multivariate normal distribution, draw independent and solve . Then has covariance . This avoids forming the inverse and exploits a banded Cholesky decomposition when is banded.
The CLIME precision-matrix estimator estimates a sparse matrix representing the precision matrix from a sample covariance matrix . An initial estimate solves
These are the entrywise matrix L1 norm and entrywise maximum norm, not the induced column-sum and row-sum norms. Writing for column and for the corresponding basis vector gives separate problems subject to , each a linear programming problem.[ref]
The column solutions need not form a symmetric matrix. The original construction selects the smaller-magnitude entry from each pair and copies it to both positions, using a common tie rule. Error analysis requires that the true precision matrix be feasible for the chosen tolerance.[ref]
Positive definiteness is not an optimization constraint here. For example, with and , the zero matrix is feasible and minimizes the objective. A positive-definite conclusion therefore needs further assumptions and a statistical theorem, rather than following from the program alone.
The Graphical Lasso estimates a sparse matrix for the precision matrix by minimizing a penalized Gaussian objective over positive-definite matrices. With a sample covariance matrix and , the all-entry penalty convention is
The entrywise matrix L1 norm encourages zero entries, while the domain enforces positive definiteness. In a Gaussian graphical model, zero off-diagonal precision matrix entries encode conditional independence given the other coordinates.[ref]
The penalty convention matters. Writing , the Graphical-Lasso Karush-Kuhn-Tucker conditions give when diagonal entries are penalized, but when they are excluded.[ref] For example, diagonal and give under the all-entry convention.
The Graphical Lasso column regression relates its matrix optimization to Lasso subproblems. This is different from independently penalizing a raw covariance inverse, and the CLIME precision-matrix estimator uses a different constrained objective.
For a Graphical Lasso solution with inverse , the unique minimizer of , , is . The inverse identity gives , and the off-diagonal Graphical-Lasso Karush-Kuhn-Tucker conditions become the column Lasso conditions because the corresponding signs are opposite.
For objective , the KKT conditions are with .
The Pearson correlation coefficient is the covariance divided by the product of the standard deviations. For real random variables with finite, strictly positive variances,
It is the expected value of the product of the two centered variables after dividing each by its standard deviation. The Cauchy-Schwarz inequality gives . This removes measurement units, while retaining the direction and strength of the linear relationship. Constant random variables have zero standard deviation, so their Pearson correlation coefficient is undefined.
For the covariance model , with independently uniform on , the calculation gives
The positive correlation is less than one because the independent term introduces extra variation. For the correlation is . Both examples appear in the covariance diagram.
For nonzero real , the correlation of and is . Positive rescaling and added offsets therefore leave the correlation unchanged; reversing one scale reverses its sign. Equality means that one random variable is an affine function of the other almost surely, with a nonzero slope of the corresponding sign. This is the equality condition in the Cauchy-Schwarz inequality, and includes perfect positive correlation.
Zero correlation says that the centered variables are orthogonal in their square-integrable inner product. It permits nonlinear statistical dependence, as the example in uncorrelated random variables demonstrates. More generally, a correlation is a statement about a joint probability distribution; identifying effects of interventions is the separate task of causal inference. This distinction keeps an observed association from being mistaken for a demonstrated mechanism.
An early source for standardized association is Francis Galton's 1888 paper “Co-relations and their Measurement, chiefly from Anthropometric Data”. He compared stature and forearm measurements and changed each measurement to units of its own variability so the two regression directions could be compared. His scale used probable error, so it should not be identified word for word with the modern standard deviation formula above. [ref].
The correlation coefficient computed under a conditional distribution, using its conditional covariance and positive conditional variances. It can depend on the observed conditioning value. For a multivariate normal distribution, conditioning on other coordinates gives the corresponding partial correlation.
The partial correlation is the correlation of residuals after linearly projecting each of two variables on the conditioning variables and an intercept. With nonsingular covariance matrix, subtracting the two least-squares predictors gives residual covariance and residual variances . Dividing gives the displayed formula. For a multivariate normal distribution, it is also the conditional correlation, independent of the conditioning value; this equality need not hold for general distributions.
For square-integrable variables of positive variance, correlation one is equivalent to with . The squared norm of the difference between the two standardized centered variables is , proving the equivalence. For uncentered variables the relationship can have a nonzero intercept; it need not be proportionality.
Fix a common Brownian motion and a finite horizon . Let positive zero-rate stock prices satisfy
with predictable processes bounded in absolute value by a deterministic constant. Their stochastic exponentials are martingales with finite second moments.
If for a deterministic constant , equality of the expected values forces . The martingale identity then gives at each . Continuity of the paths makes this equality hold simultaneously for all times outside a single null set.
Subtract the two Itô integrals. The Itô isometry gives
Since , the coefficients are equal almost everywhere for the product measure . The common driving Brownian motion is part of the statement.
Perfect positive correlation gives an affine terminal relation that may have a nonzero intercept. It does not supply the proportionality used here; the terminal correlation does not identify adapted stock volatility example demonstrates that distinction.
The stocks and start at one, are true square-integrable zero-rate martingales, and have perfect positive correlation at each positive time. Their bounded multiplicative volatilities are and , which differ throughout. The additive intercept is what allows the same correlation but different stochastic-exponential coefficients.
Responses observed on the same process or individual at different times may have nonzero correlation coefficients. Such serial correlation can arise from a shared random effect or from history-dependent conditional means. A scalar dispersion parameter adjustment alone does not represent this temporal dependence.
The intraclass correlation coefficient measures the correlation between observations in the same group. In a random-intercept model with group variance and individual variance , it is .

Ancestors (8)

  1. Covariance
  2. Variance
  3. Expected value
  4. Probability theory
  5. Probability and statistics
  6. Area of mathematics
  7. Mathematics
  8. Home

Synonyms (1)

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (1)

A covariance matrix is a square matrix that captures the covariance between multiple random variables. It is a key concept in statistics, probability theory, and multivariate data analysis. Each element in the covariance matrix represents the covariance between two variables.