Tutorials › Generalized Linear Models › Positive-Definite Constraints in Correlation Estimation

Working Correlation Choices · Tutorial 869 of 981

Positive-Definite Constraints in Correlation Estimation

See why individually plausible correlations can be jointly impossible, and compare parameterizations, eigenvalue diagnostics, and repair strategies for working-correlation matrices.

Advanced 10 min read

What You'll Learn

  • Distinguish a valid positive-semidefinite correlation matrix from a strictly positive-definite working matrix.
  • Verify why pairwise correlations within minus one and one can still produce an invalid matrix.
  • Parameterize a three-variable positive-definite correlation matrix using partial correlations.
  • Use eigenvalues to check validity and identify near-singularity.
  • Repair an invalid estimate by eigenvalue clipping and diagonal rescaling, while recognizing what the repair changes.

Why Pairwise Bounds Are Not Enough

In GEE, a working correlation matrix describes the joint dependence assigned to responses within a cluster. Its diagonal entries must be one, and each off-diagonal entry must be a correlation, hence lie between minus one and one. But these pairwise conditions do not ensure that all the entries can describe a single joint distribution. The correlations must also be jointly compatible.

For a working covariance matrix to be a valid covariance matrix, its correlation matrix must be positive semidefinite. In many GEE calculations the working covariance is inverted, so strict positive definiteness is the practically useful requirement: it guarantees that the matrix is invertible. An unconstrained collection of estimated pairwise residual correlations can fail either requirement even when every estimate is individually within its allowed range.

Definition: A correlation matrix \(R\) is a symmetric matrix with \(R_{ii}=1\) for every \(i\). It is a valid (possibly singular) correlation matrix if it is positive semidefinite, meaning \(x^\mathsf{T}Rx\geq 0\) for every real vector \(x\). It is strictly positive definite if \(x^\mathsf{T}Rx>0\) for every nonzero \(x\). A strictly positive-definite matrix is invertible; a positive-semidefinite matrix need not be.

For two responses, the condition that their correlation lies between minus one and one is enough. With three or more responses, the pairwise bounds are necessary but not sufficient. The determinant and, more generally, the eigenvalues encode additional joint constraints.

Worked Example: Valid Pairwise Correlations, Invalid Matrix

Consider three responses with proposed pairwise correlations \(r_{12}=0.9\), \(r_{13}=0.9\), and \(r_{23}=-0.9\). Each lies in the permitted interval, so each pair considered separately looks possible. The proposed matrix is

$$ R= \begin{pmatrix} 1&0.9&0.9\\ 0.9&1&-0.9\\ 0.9&-0.9&1 \end{pmatrix}. $$

For a three-variable correlation matrix with off-diagonal entries \(a,b,c\), its determinant is \(1+2abc-a^2-b^2-c^2\). Here,

$$ \det(R)=1+2(0.9)(0.9)(-0.9)-0.9^2-0.9^2-(-0.9)^2 =1-1.458-2.43=-2.888. $$

A positive-semidefinite matrix cannot have a negative determinant: its eigenvalues are all nonnegative, and their product is the determinant. Thus \(R\) is not a valid correlation matrix, despite all three pairwise values satisfying their individual bounds. Intuitively, the first response is proposed to correlate strongly and positively with each of the other two, while those two are proposed to correlate strongly and negatively with each other. Taken together, those claims are incompatible.

A Constraint for Three Responses

The three-variable case gives a compact way to see the extra constraint. Write the off-diagonal correlations as \(a=r_{12}\), \(b=r_{13}\), and \(c=r_{23}\). The determinant condition is not just a check on one isolated pair: it restricts the possible value of \(c\) once \(a\) and \(b\) have been chosen.

Theorem: Suppose \(|a|<1\) and \(|b|<1\). The matrix \(R=\begin{pmatrix}1&a&b\\a&1&c\\b&c&1\end{pmatrix}\) is strictly positive definite if and only if \[ q=\frac{c-ab}{\sqrt{(1-a^2)(1-b^2)}} \] satisfies \(|q|<1\). Equivalently, for fixed \(a,b\), strict positive definiteness requires \(ab-\sqrt{(1-a^2)(1-b^2)}<c<ab+\sqrt{(1-a^2)(1-b^2)}\).

The quantity \(q\) is the partial correlation between the second and third variables after their linear associations with the first have been removed. Its role here is algebraic as well: it scales the allowable range for \(c\).

Proof. For any real \(x_1,x_2,x_3\), direct expansion gives

$$ \begin{aligned} x^\mathsf{T}Rx ={}&(x_1+ax_2+bx_3)^2\\ &+(1-a^2)\left(x_2+\frac{c-ab}{1-a^2}x_3\right)^2 +\frac{\det(R)}{1-a^2}x_3^2. \end{aligned} $$

The determinant can also be written as \[ \det(R)=(1-a^2)(1-b^2)-(c-ab)^2 =(1-a^2)(1-b^2)(1-q^2). \] Since \(|a|<1\), the first squared term and the coefficient \(1-a^2\) in the second term are positive. If \(|q|<1\), then \(\det(R)>0\), so the coefficient of \(x_3^2\) is positive too. The displayed decomposition is then a sum of three nonnegative terms, and it can equal zero only when \(x_3=0\), then \(x_2=0\), then \(x_1=0\). Thus \(R\) is strictly positive definite. Conversely, strict positive definiteness requires \(\det(R)>0\); the determinant identity and \(1-a^2>0\), \(1-b^2>0\) imply \(1-q^2>0\), or \(|q|<1\). This proves both directions. \(\square\)

Worked Example: Constructing a Valid Matrix With a Partial Correlation

Choose \(a=0.6\), \(b=0.2\), and \(q=-0.5\). All three chosen parameters lie strictly between minus one and one. Set \(c=ab+q\sqrt{(1-a^2)(1-b^2)}\). The calculation is

$$ c=(0.6)(0.2)-0.5\sqrt{(1-0.6^2)(1-0.2^2)} =0.12-0.5\sqrt{0.64\cdot0.96} \approx -0.2719. $$

This gives

$$ R\approx \begin{pmatrix} 1&0.6&0.2\\ 0.6&1&-0.2719\\ 0.2&-0.2719&1 \end{pmatrix}. $$

The determinant is \((1-a^2)(1-b^2)(1-q^2)=0.64\cdot0.96\cdot0.75=0.4608>0\). The theorem therefore verifies strict positive definiteness, not merely that the three entries fall within their pairwise bounds. This parameterization builds compatibility into the construction: choose \(a,b,q\) in the open interval and compute \(c\), rather than estimating all three correlations without a joint constraint.

Parameterizations That Enforce the Constraint

A constrained parameterization is useful when a procedure must produce a valid matrix at every iteration. For three responses, the construction just used takes \(a,b,q\) in \((-1,1)\) and sets \(c=ab+q\sqrt{(1-a^2)(1-b^2)}\). The theorem shows that every such choice gives a strictly positive-definite correlation matrix, and that every strictly positive-definite three-variable correlation matrix can be represented this way.

For larger matrices, a common general strategy is to parameterize a Cholesky factor or a sequence of partial correlations, then build the correlation matrix from those parameters. The details depend on the chosen parameterization, but the objective is the same: make the allowed parameter values enforce positive definiteness, instead of relying on separately estimated pairwise correlations to happen to be compatible. Such parameterizations can be harder to interpret in terms of ordinary pairwise correlations, and constrained estimation can give different answers from unconstrained pairwise moment estimates.

Eigenvalue Checks and What They Tell You

A direct diagnostic is to calculate the eigenvalues of the assembled matrix. The following criterion is a consequence of the spectral theorem for real symmetric matrices.

Theorem: A real symmetric matrix \(R\) is positive semidefinite if and only if all its eigenvalues are nonnegative. It is strictly positive definite if and only if all its eigenvalues are positive.

Proof. By the spectral theorem, there is an orthogonal matrix \(Q\) and a diagonal matrix \(\Lambda\) of real eigenvalues such that \(R=Q\Lambda Q^\mathsf{T}\). For any vector \(x\), put \(y=Q^\mathsf{T}x\). Then \(x^\mathsf{T}Rx=y^\mathsf{T}\Lambda y=\sum_i\lambda_i y_i^2\). If every \(\lambda_i\geq0\), this sum is nonnegative for every \(x\); if every \(\lambda_i>0\), it is positive for every nonzero \(x\). Conversely, if some \(\lambda_j<0\), choosing \(x\) to be a corresponding unit eigenvector gives \(x^\mathsf{T}Rx=\lambda_j<0\). If \(\lambda_j=0\), the same vector gives a zero quadratic form, so \(R\) is not strictly positive definite. \(\square\)

In numerical work, eigenvalues close to zero deserve attention even if rounding makes them appear slightly positive or negative. A matrix with a very small positive minimum eigenvalue is technically invertible but close to singular; its inverse can be highly sensitive to small changes in the entries. A practical check therefore considers both the sign and the scale of the smallest eigenvalue, using a tolerance appropriate to the numerical precision and application.

Repairing an Invalid Estimate

If an unconstrained estimate is not positive definite, one option is to repair it. A simple spectral repair replaces negative eigenvalues by zero (or by a small positive floor), reconstructs the matrix, and rescales it to have diagonal entries one. This gives a useful illustration, but it is not automatically the unique or scientifically best repair. Different distance criteria and constraints can yield different repaired matrices.

Worked Example: Eigenvalue Clipping and Rescaling

Return to the invalid matrix with correlations \(0.9,0.9,-0.9\). Its eigenvalues are \(1.9,1.9,-0.8\). The unit eigenvector for \(-0.8\) is \(u=(1,-1,-1)^\mathsf{T}/\sqrt{3}\). Replacing that negative eigenvalue by zero adds \(0.8uu^\mathsf{T}\) to \(R\):

$$ R_+=R+0.8uu^\mathsf{T} = \begin{pmatrix} 1.2667&0.6333&0.6333\\ 0.6333&1.2667&-0.6333\\ 0.6333&-0.6333&1.2667 \end{pmatrix}. $$

The diagonal is no longer one. Divide every entry by \(1.2667\), equivalently rescale each variable by the square root of its diagonal entry. The repaired correlation matrix is

$$ R_{\mathrm{repair}}= \begin{pmatrix} 1&0.5&0.5\\ 0.5&1&-0.5\\ 0.5&-0.5&1 \end{pmatrix}. $$

Its eigenvalues are \(1.5,1.5,0\), so it is positive semidefinite, but singular. If an inverse is required, a positive floor or a further shrinkage toward the identity matrix is needed. For example, for \(0<\delta<1\), \((1-\delta)R_{\mathrm{repair}}+\delta I\) has diagonal entries one and eigenvalues \(1.5-0.5\delta,\ 1.5-0.5\delta,\ \delta\), all strictly positive. This final step changes the correlations again; repair is not a way to recover the original unconstrained estimates unchanged.

Choosing a Practical Approach

The appropriate method depends on how the working correlation is obtained and what the subsequent calculation requires. A constrained parameterization prevents invalid matrices by construction. An eigenvalue check is a direct diagnostic for any assembled symmetric candidate, including a matrix formed from pairwise residual estimates. A repair can make a candidate usable, but it should be recorded and interpreted as a change to the estimated dependence structure.

ApproachWhat it doesMain consideration
Constrained parameterizationRestricts parameters so the resulting matrix is positive definiteMay make parameters less directly interpretable as pairwise correlations
Eigenvalue checkDiagnoses positive definiteness or semidefiniteness of an assembled matrixChecks validity but does not itself produce a corrected matrix
Matrix repairModifies an invalid matrix to meet a validity constraintThe result depends on the repair rule and can alter the estimated correlations

A frequent mistake is to check only that each estimated correlation is between minus one and one and then assume the whole matrix is valid. That verifies the pairwise bounds, not joint compatibility. The correction is to assemble the full symmetric matrix and check its eigenvalues, or to use a construction that enforces positive definiteness from the start. Also distinguish a singular but valid correlation matrix from a strictly positive-definite one: the former can represent a degenerate covariance structure, but it cannot be inverted as a working covariance matrix.

Key takeaway: Pairwise plausibility does not imply joint validity. Positive definiteness is a property of the whole correlation matrix; enforce it through a constrained parameterization, diagnose it with eigenvalues, and treat any repair as a consequential change to the working correlations.

Check Your Understanding

Use these questions to test whether you can distinguish pairwise bounds from matrix-level constraints.

  1. Why do three correlations within minus one and one not necessarily define a valid three-variable correlation matrix?
  2. For \(a=0.5\) and \(b=-0.2\), what condition on \(c\) makes the three-variable correlation matrix strictly positive definite?
  3. What does a zero eigenvalue imply about positive semidefiniteness and invertibility?
  4. Why can eigenvalue clipping followed by diagonal rescaling change the estimated pairwise correlations?
  5. In what sense does a partial-correlation parameterization enforce validity rather than merely check it?
Clinical Biostats