Why LD Matrix Stability Matters
Many summary-statistic methods estimate variant weights by relating marginal association statistics to joint effects through linkage disequilibrium (LD). In a common standardized formulation, \(m\) is the vector of marginal effect estimates and \(R\) is the LD correlation matrix for the included variants. A basic linear relation is \(m \approx Rw\), where \(w\) is a vector of joint effects or weights. Solving this relation directly requires an invertible, numerically stable matrix. If two variants are nearly redundant, small perturbations in the entries of \(R\) or \(m\) can produce large changes in the resulting weights.
The issue is not only whether software returns an answer. An ill-conditioned matrix can yield weights that depend strongly on rounding, small changes in the reference sample, or details of the numerical solver. Regularization can make computation more stable, but it generally changes the estimated weights as well. It is therefore important to identify the source of instability and state what the chosen remedy does.
Where Instability Comes From
An LD matrix is usually computed as a correlation matrix of genotype columns after allele alignment and consistent variant filtering. In exact arithmetic, a correlation matrix is symmetric and positive semidefinite: for every vector \(a\), \(a^\mathsf{T}Ra\geq 0\). It is positive definite only when the included genotype columns are linearly independent in the relevant sample. If the reference panel has \(n_{\mathrm{ref}}\) individuals, centered genotype columns have rank at most \(n_{\mathrm{ref}}-1\). Thus, when the number of included variants exceeds that rank, the matrix must be singular. Even when there are fewer variants, duplicates, near-duplicates, or strong LD can make the smallest eigenvalue very small.
These facts assume that the matrix is built from the same aligned variants and the same reference individuals, with valid genotype measurements and consistent scaling. They do not guarantee that the reference panel represents the target population; that is a separate question. Nor does a matrix that looks symmetric and positive semidefinite guarantee good conditioning. A matrix can satisfy both properties and still have eigenvalues spanning many orders of magnitude.
Before solving a system, inspect the dimensions and variant order, check that \(R\) is approximately symmetric and has the expected diagonal, and examine its eigenvalues or singular values. Tiny negative eigenvalues can arise from rounding, but substantial negative eigenvalues suggest a construction, alignment, or data problem rather than ordinary near-singularity. For a proposed solution \(\hat w\), also check the residual \(r=m-R\hat w\). A small residual is useful but not conclusive: a sensitive system can have a small residual and still yield weights that change substantially under small input perturbations.
Worked Example: Near-Duplicate Variants Produce Large Weights
Suppose two standardized variants have LD matrix \(R=\begin{pmatrix}1&0.999\\0.999&1\end{pmatrix}\), and the marginal effects are \(m=(0.20,0.19)^\mathsf{T}\). Assume the variants are aligned consistently, and use the unregularized system \(Rw=m\). The eigenvalues of \(R\) are \(1.999\) and \(0.001\), so \(R\) is positive definite but has condition number \(1.999/0.001=1999\).
For a two-variant correlation matrix with off-diagonal entry \(r\), the solution is \(w_1=(m_1-rm_2)/(1-r^2)\) and \(w_2=(m_2-rm_1)/(1-r^2)\). Here \(1-r^2=1-0.999^2=0.001999\), giving \(w_1=(0.20-0.999(0.19))/0.001999=0.01019/0.001999\approx5.098\), and \(w_2=(0.19-0.999(0.20))/0.001999=-0.0098/0.001999\approx-4.902\).
These large, opposite-signed weights combine to represent marginal effects that are close together. They should not be read as stable, independently supported effects: the small difference between the two marginal effects is being divided by a very small eigenvalue. The calculation identifies a sensitivity problem, not evidence that the variants truly have large opposing effects.
Stabilizing the System: Filtering and Regularization
One response is to remove variants that are redundant or poorly measured, then recompute the matrix and solve the reduced system. This can improve rank and conditioning, but changes the set of modeled variants. Variant removal should follow defensible rules, such as excluding duplicate records or choosing one representative from a highly correlated group, rather than being driven solely by a desire to obtain convenient weights. Clumping is one familiar way to reduce correlated variants for particular score constructions; it is not identical to stabilizing a dense LD matrix for a shrinkage method.
A second response is ridge regularization: replace the system \(Rw=m\) with \((R+\lambda I)w=m\), where \(I\) is the identity matrix and \(\lambda>0\). If \(R\) is symmetric positive semidefinite, its eigenvalues are nonnegative, and those of \(R+\lambda I\) are \(d_j+\lambda\). The regularized matrix is positive definite, with condition number \((d_{\max}+\lambda)/(d_{\min}+\lambda)\). This is no larger than \(d_{\max}/d_{\min}\) when \(d_{\min}>0\), and is strictly smaller when \(d_{\max}>d_{\min}\). If the original matrix is singular, adding positive \(\lambda\) makes the smallest eigenvalue positive. Regularization reduces sensitivity but shrinks the solution along low-eigenvalue directions; \(\lambda\) is therefore a modeling choice as well as a numerical one.
For the positive-semidefinite case, the reason is direct: adding \(\lambda\) increases every eigenvalue by the same amount, while the ratio of largest to smallest becomes less extreme. If \(0\leq d_{\min}\leq d_{\max}\), then \((d_{\max}+\lambda)/(d_{\min}+\lambda)\leq d_{\max}/d_{\min}\) when \(d_{\min}>0\), because cross-multiplication reduces the inequality to \(d_{\min}\lambda\leq d_{\max}\lambda\). Equality holds when \(d_{\min}=d_{\max}\); if \(d_{\min}=0\), the unregularized matrix is singular and has no finite condition number.
Worked Example: Ridge Regularization Changes the Weights
Use the matrix and marginal effects from the previous example, but solve \((R+0.01I)w=m\). The two eigenvalues become \(2.009\) and \(0.011\), so the condition number falls from \(1999\) to \(2.009/0.011\approx182.6\). This is a substantial improvement, although the regularized system remains more sensitive along the contrast between the variants than along their shared direction.
The shared direction is proportional to \((1,1)^\mathsf{T}\); the contrast direction is proportional to \((1,-1)^\mathsf{T}\). The components of \(m\) along these directions have per-coordinate values \((0.20+0.19)/2=0.195\) and \((0.20-0.19)/2=0.005\). After regularization, the corresponding weight components are \(0.195/2.009\approx0.09706\) and \(0.005/0.011\approx0.4545\). Therefore \(w_1\approx0.09706+0.4545=0.5516\) and \(w_2\approx0.09706-0.4545=-0.3575\).
The regularized weights are much smaller in magnitude than the unregularized values, but they are not the same estimates. The calculation illustrates both purposes of ridge regularization: it improves conditioning and suppresses the unstable contrast component. The choice \(\lambda=0.01\) must be justified for the method and data, not treated as a purely harmless numerical setting.
A Small Derivation of Weight Sensitivity
A perturbation bound makes the role of conditioning precise. Suppose \(R\) is nonsingular, \(m\ne0\), and \(w=R^{-1}m\). Let the computed or perturbed inputs be \(R+\Delta R\) and \(m+\Delta m\), and let \(\hat w=(R+\Delta R)^{-1}(m+\Delta m)\). Define \(\eta=\|R^{-1}\|_2\|\Delta R\|_2\), and suppose \(\eta<1\). Then \(R+\Delta R\) is nonsingular. Indeed, \(R+\Delta R=R(I+R^{-1}\Delta R)\), and a matrix \(I+A\) is invertible when \(\|A\|_2<1\).
Subtracting the original equation from the perturbed one gives \((R+\Delta R)(\hat w-w)=\Delta m-\Delta Rw\). Also, \(\|(R+\Delta R)^{-1}\|_2\leq\|R^{-1}\|_2/(1-\eta)\), by the geometric-series bound for the inverse of \(I+R^{-1}\Delta R\). Since \(\|m\|_2=\|Rw\|_2\leq\|R\|_2\|w\|_2\), and \(m\ne0\) implies \(w\ne0\), it follows that \[ \frac{\|\hat w-w\|_2}{\|w\|_2} \leq \frac{\kappa_2(R)\,\|\Delta m\|_2/\|m\|_2+\eta}{1-\eta}, \qquad \eta=\kappa_2(R)\frac{\|\Delta R\|_2}{\|R\|_2}<1. \]
Thus a large \(\kappa_2(R)\) can amplify relative perturbations in either input. The relative bound is stated for \(m\ne0\), so its denominators are defined. A version that also covers \(m=0\) is the absolute inequality \(\|\hat w-w\|_2\leq\|R^{-1}\|_2(\|\Delta m\|_2+\|\Delta R\|_2\|w\|_2)/(1-\eta)\), under the same condition \(\eta<1\). These bounds are worst-case guarantees, not predictions of the exact error in a particular data set.
Worked Example: Choosing Regularization From a Conditioning Target
Suppose a positive-semidefinite LD matrix has smallest eigenvalue \(0.0004\) and largest eigenvalue \(1.6\). Its unregularized condition number is \(1.6/0.0004=4000\). To make the regularized condition number at most \(50\), require \((1.6+\lambda)/(0.0004+\lambda)\leq50\).
Multiplying by the positive denominator gives \(1.6+\lambda\leq0.02+50\lambda\), hence \(1.58\leq49\lambda\), or \(\lambda\geq1.58/49\approx0.03224\). Choosing \(\lambda=0.04\) gives condition number \(1.64/0.0404\approx40.59\), which meets the target. This calculation selects a numerical conditioning threshold; it does not establish that \(\lambda=0.04\) is optimal for prediction or scientifically appropriate. Those questions require a method-specific justification.
Diagnostics, Alternatives, and Failure Modes
A stable workflow separates checking the matrix from deciding how to modify it. Check that variants appear in the same order in \(R\) and \(m\); that alleles and genotype coding are aligned; that entries are finite; and that the diagonal and symmetry match the construction. Inspect the spectrum and report the condition number or smallest eigenvalues. After solving, evaluate the residual and, where feasible, compare solutions under modest changes in precision or reference sampling. A solver warning, a very large condition number, or weights that change sharply under small perturbations calls for investigation rather than automatic acceptance.
Three common approaches address different problems. Filtering reduces redundancy by changing the variant set. Ridge regularization retains the variants but changes the linear system and shrinks unstable directions. A pseudoinverse sets sufficiently small singular directions to zero, while eigenvalue clipping replaces problematic eigenvalues with a chosen floor; both define altered solutions or matrices and require an explicit threshold. If the matrix is materially indefinite, first investigate its construction. Symmetrizing \(R\) by replacing it with \((R+R^\mathsf{T})/2\) can remove tiny asymmetry from rounding, but cannot repair incorrect variant alignment or a badly constructed reference matrix.
For a singular system with a consistent right-hand side, infinitely many solutions may exist; for an inconsistent right-hand side, no exact solution exists. A pseudoinverse returns a particular minimum-norm least-squares solution, not a uniquely identified biological effect vector. Similarly, adding a ridge penalty produces a unique answer but does not create information about directions unsupported by the data. Regularization parameters, filtering thresholds, and eigenvalue floors can materially affect weights, so they should be documented and checked for sensitivity.
Worked Example: Exact Redundancy and Non-Unique Weights
Consider two perfectly correlated standardized variants with \(R=\begin{pmatrix}1&1\\1&1\end{pmatrix}\) and \(m=(0.30,0.30)^\mathsf{T}\). The matrix has eigenvalues \(2\) and \(0\), so it is singular. The equations \(Rw=m\) reduce to \(w_1+w_2=0.30\). For example, \((0.30,0)^\mathsf{T}\) and \((0.15,0.15)^\mathsf{T}\) both solve the equations; the data encoded in this system do not distinguish these allocations.
With ridge \(\lambda=0.10\), symmetry gives equal weights and the common-direction eigenvalue becomes \(2.10\). Thus \(w_1=w_2=0.30/2.10\approx0.1429\). The weights now have a unique, stable solution, but their allocation reflects the penalty and symmetry, not new information separating the identical variants. Alternatively, retaining one representative gives the one-variant system \(1w=0.30\), with weight \(0.30\). These choices have different coefficients, even though the underlying variants are redundant.
Common Mistakes and Practical Interpretation
- Calling a matrix stable because it is invertible. A smallest eigenvalue close to zero can make an invertible matrix highly sensitive. Report conditioning, not just whether an inverse exists.
- Treating ridge as a numerical fix with no inferential effect. The solution to \((R+\lambda I)w=m\) differs from the unregularized solution and depends on \(\lambda\).
- Interpreting large opposing weights as robust variant-specific evidence. Near-collinear variants can have unstable weights even when their combined contribution is more stable.
- Using a pseudoinverse without stating its threshold. The choice of which small singular values to discard affects the answer.
- Repairing a bad matrix without checking its source. Eigenvalue clipping or forced symmetry cannot correct a variant-order mismatch or allele-coding error.
The practical goal is not to make every weight look reasonable by any available adjustment. It is to identify whether instability comes from redundant variants, limited reference-panel rank, numerical precision, or a matrix construction error; choose a remedy suited to that cause; and describe the resulting estimand honestly.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- A positive-definite matrix has eigenvalues \(0.02\) and \(2.00\). What is its condition number, and what does the value indicate?
- Why can a matrix computed from a finite reference panel be singular even when all genotype columns have been standardized?
- If \(R\) is positive semidefinite, what happens to its eigenvalues after adding \(\lambda I\) for \(\lambda>0\)? Does this leave the estimated weights unchanged?
- For exact duplicate variants and \(m=(0.4,0.4)^\mathsf{T}\), describe the unregularized solutions and explain why the individual weights are not identified.
- Why must a relative perturbation bound involving \(\|\Delta m\|_2/\|m\|_2\) state that \(m\ne0\)?
Solutions. (1) The condition number is \(2.00/0.02=100\), indicating potential amplification of relative perturbations by a factor on the order of 100 in worst-case directions. (2) Centered columns have rank at most \(n_{\mathrm{ref}}-1\), so a matrix with more variants than that rank must be singular; linear dependencies can also arise with fewer variants. (3) Each eigenvalue \(d_j\) becomes \(d_j+\lambda\), making the matrix positive definite, but the solution generally changes because the system becomes \((R+\lambda I)w=m\). (4) Any pair satisfying \(w_1+w_2=0.4\) is a solution, so the system fixes only the combined effect, not its allocation. (5) The ratio divides by \(\|m\|_2\), which is zero when \(m=0\); the relative expression is then undefined, although an absolute bound can still be stated.