Tutorials › Statistical Genetics › Summary-Statistic Ridge Estimation with LD

Polygenic Score Construction · Tutorial 708 of 989

Summary-Statistic Ridge Estimation with LD

Learn how to recover shrunken joint-effect weights from marginal GWAS estimates and an LD matrix, and how to check whether those inputs are compatible.

Intermediate 10 min read

What You'll Learn

  • Relate marginal GWAS effects to joint effects through the LD matrix
  • Derive the summary-statistic ridge estimator from the ridge objective
  • Calculate joint weights for correlated and uncorrelated variants
  • Explain how allele flips and variant ordering change LD inputs
  • Identify assumptions required when GWAS summaries and LD come from different sources
  • Recognize when incompatible sample sizes, scaling, or populations undermine the estimate

Why Combine GWAS Effects With LD?

A GWAS effect for one variant is usually a marginal association: it describes the variant’s association with the phenotype without jointly adjusting for all the other variants in a region. When nearby variants are correlated through linkage disequilibrium (LD), each can partly tag the effects of the others. Consequently, a set of marginal effects is not generally a set of joint effects suitable for a weighted-sum score.

Ridge estimation addresses this by using an LD matrix to account for correlation while shrinking the estimated joint effects. With summary data, the calculation can often be done without individual-level genotypes: the marginal effects and a compatible LD matrix provide the key quantities. This is an algebraic reconstruction under specified assumptions, not a guarantee that the inputs from different sources describe the same genetic structure.

Model and Summary-Statistic Estimator

Suppose there are \(m\) variants. Let \(X\) be the \(n\)-by-\(m\) genotype matrix after centering and scaling each variant to have sample variance one, and let \(y\) be the centered phenotype. If covariates are used, take \(X\) and \(y\) here to mean the variables after the same covariate adjustment. Consider the linear model \(y=X\beta+\varepsilon\), where \(\beta\) is the vector of joint effects in phenotype units per one standard deviation of genotype, and \(\varepsilon\) is the residual vector.

Definition: The LD matrix is \(R=X^\mathsf{T}X/n\), so its \(j,k\) entry is the sample correlation between the scaled genotypes at variants \(j\) and \(k\). The marginal-effect vector is \(b_{\mathrm{marg}}=X^\mathsf{T}y/n\): its \(j\)th entry is the marginal regression coefficient for variant \(j\) with this scaling. The ridge-style summary-statistic estimate is $$ \hat{\beta}_{\mathrm{ridge}}=(R+\lambda I)^{-1}b_{\mathrm{marg}}, $$ where \(I\) is the \(m\)-by-\(m\) identity matrix and \(\lambda>0\) is the ridge penalty under the objective defined below.

This form follows when the same genotype and phenotype data generate both \(R\) and \(b_{\mathrm{marg}}\). For use with separate sources, the equation is an approximation whose validity depends on how well those sources align. In particular, the GWAS effect alleles, variant order, genotype scaling, and LD definition must match. Also, if effects are reported per allele count rather than per standard deviation of genotype, they must be converted to the intended scale before using this formula.

The ridge objective corresponding to this convention is the residual sum of squares divided by \(2n\), plus a squared-effect penalty:

$$ \hat{\beta}_{\mathrm{ridge}} =\arg\min_{\beta}\left\{ \frac{1}{2n}(y-X\beta)^\mathsf{T}(y-X\beta) +\frac{\lambda}{2}\beta^\mathsf{T}\beta \right\}. $$

Here \(\lambda\) controls shrinkage. It is not interchangeable across differently scaled objectives: if the objective instead uses the unscaled residual sum of squares plus a penalty, the numerical penalty must be adjusted for \(n\). With standardized genotypes, the entries of \(R\) are dimensionless and the estimated effects retain the phenotype units used for \(y\).

Why the Formula Works

The sample marginal effects and the joint effects are linked by the model. Substituting \(y=X\beta+\varepsilon\) into the marginal-effect vector gives

$$ b_{\mathrm{marg}} =\frac{X^\mathsf{T}y}{n} =\frac{X^\mathsf{T}X}{n}\beta+\frac{X^\mathsf{T}\varepsilon}{n} =R\beta+\frac{X^\mathsf{T}\varepsilon}{n}. $$

Thus, apart from sampling noise, the marginal effects are the LD matrix times the joint effects. The estimator uses this relationship while adding a penalty that stabilizes the inversion when variants are highly correlated.

Assumptions and conditions: For the direct same-sample derivation, the linear model is an appropriate description of the phenotype on the included genotypes after any covariate adjustment; the marginal effects and LD matrix use the same individuals, variants, allele coding, and genotype scaling; and \(R\) is calculated from the same adjusted genotype data. The residual need not be normally distributed for the algebraic ridge estimate, though assumptions about residuals matter for other inferential claims. For the inverse to exist, \(R+\lambda I\) must be nonsingular; a positive \(\lambda\) ensures this for a positive-semidefinite LD matrix. When LD comes from a different sample, additional compatibility assumptions are needed, discussed below.

To derive the estimate, expand the objective and differentiate with respect to \(\beta\). Setting the gradient to zero yields the ridge normal equations.

$$ \begin{aligned} Q(\beta) &=\frac{1}{2n}(y-X\beta)^\mathsf{T}(y-X\beta) +\frac{\lambda}{2}\beta^\mathsf{T}\beta,\\ \nabla_\beta Q(\beta) &=-\frac{X^\mathsf{T}y}{n} +\frac{X^\mathsf{T}X}{n}\beta+\lambda\beta =-b_{\mathrm{marg}}+(R+\lambda I)\beta. \end{aligned} $$

At the minimum, the gradient is zero, so \((R+\lambda I)\hat{\beta}_{\mathrm{ridge}}=b_{\mathrm{marg}}\). Since \(R\) is positive semidefinite, for any nonzero vector \(v\),

$$ v^\mathsf{T}(R+\lambda I)v =v^\mathsf{T}Rv+\lambda v^\mathsf{T}v>0. $$

Therefore \(R+\lambda I\) is positive definite and invertible. Solving the normal equations gives the stated estimator. This derivation also shows why the LD matrix must correspond to the same variant representation as the marginal effects: changing allele coding changes the signs of entries and effects in ways that must be coordinated.

Worked Example: Two Correlated Variants

Suppose a hypothetical GWAS reports marginal effects \(b_{\mathrm{marg}}=(0.12,0.10)^\mathsf{T}\), in phenotype units per one standard deviation of genotype. A compatible LD matrix has correlation \(0.60\), and choose \(\lambda=0.20\). Assume the variants and effect alleles are aligned, the effects and LD use the stated scaling, and the LD estimate is suitable for the GWAS sample.

The matrices for the ridge calculation are

$$ R+\lambda I= \begin{pmatrix}1.20&0.60\\0.60&1.20\end{pmatrix}, \qquad (R+\lambda I)^{-1} =\frac{1}{1.08} \begin{pmatrix}1.20&-0.60\\-0.60&1.20\end{pmatrix}. $$

The determinant is \(1.20(1.20)-0.60(0.60)=1.08\), and hence

$$ \hat{\beta}_{\mathrm{ridge}} =\frac{1}{1.08} \begin{pmatrix} 1.20(0.12)-0.60(0.10)\\ -0.60(0.12)+1.20(0.10) \end{pmatrix} =\frac{1}{1.08} \begin{pmatrix}0.084\\0.048\end{pmatrix} = \begin{pmatrix}0.07778\\0.04444\end{pmatrix}. $$

The joint ridge weights are about \(0.07778\) and \(0.04444\) phenotype units per genotype standard deviation. The marginal effects are not simply copied as weights: their shared LD contributes to each marginal association, and the penalty further shrinks the joint estimates.

Worked Example: Independent Variants and Shrinkage

For a second hypothetical calculation, suppose three standardized variants are mutually uncorrelated in the relevant sample, so \(R=I\), and their marginal effects are \((0.06,-0.03,0.09)^\mathsf{T}\). Use \(\lambda=0.50\). Assume the same allele and scale conventions for all three variants.

Then \(R+\lambda I=1.50I\), so its inverse is \((1/1.50)I\). The calculation is

$$ \hat{\beta}_{\mathrm{ridge}} =(1.50I)^{-1} \begin{pmatrix}0.06\\-0.03\\0.09\end{pmatrix} =\frac{1}{1.50} \begin{pmatrix}0.06\\-0.03\\0.09\end{pmatrix} = \begin{pmatrix}0.040\\-0.020\\0.060\end{pmatrix}. $$

With no correlations, the ridge operation reduces to multiplying each marginal effect by \(1/(1+\lambda)=2/3\). The effects remain in the same units and retain their signs. This illustrates shrinkage, not a change in the definition of an effect.

Combining GWAS Summaries With an LD Reference

In practice, the GWAS summary statistics and the LD matrix may come from different data sources. The calculation is meaningful only if the inputs refer to compatible variants and genetic coding. For each variant, verify the identifier, genome build if relevant, effect allele, other allele, and ordering. A sign error in one effect or one row and column of \(R\) can alter the resulting weights.

If one genotype column is recoded by reversing its allele, its sign changes. Let \(D\) be diagonal with entries \(+1\) for unchanged coding and \(-1\) for flipped coding. The matched quantities transform as

$$ b_{\mathrm{marg}}^{*}=Db_{\mathrm{marg}}, \qquad R^{*}=DRD. $$

If variants are reordered, the same permutation must be applied to the effects and to both dimensions of the LD matrix. These are not optional formatting details: the \(j\)th effect must correspond to the \(j\)th row and column representing that same coded variant.

Worked Example: Reordering and Flipping an LD Input

Consider hypothetical GWAS effects in the order \((v_1,v_2)\), coded to the GWAS effect alleles, with \(b_{\mathrm{marg}}=(0.08,0.05)^\mathsf{T}\). An LD reference reports variants in the order \((v_2,v_1)\) and uses the opposite allele coding for \(v_2\). Suppose its reported correlation is \(+0.40\). Reordering alone leaves the correlation as \(+0.40\); flipping the coding of \(v_2\) changes the matched correlation to \(-0.40\). Thus the LD matrix aligned to the GWAS coding is

$$ R^{*}= \begin{pmatrix}1&-0.40\\-0.40&1\end{pmatrix}. $$

With \(\lambda=0.10\), and assuming the reported GWAS effects already use the stated GWAS coding and scale, the aligned calculation is

$$ \begin{aligned} \hat{\beta}_{\mathrm{ridge}} &=\frac{1}{1.21-0.16} \begin{pmatrix}1.10&0.40\\0.40&1.10\end{pmatrix} \begin{pmatrix}0.08\\0.05\end{pmatrix}\\ &=\frac{1}{1.05} \begin{pmatrix}0.108\\0.087\end{pmatrix} = \begin{pmatrix}0.1029\\0.08286\end{pmatrix}. \end{aligned} $$

The determinant is \(1.10^2-0.40^2=1.05\). If the unflipped positive correlation were used instead, the numerator would be \((0.068,0.023)^\mathsf{T}\), giving approximately \((0.06476,0.02190)^\mathsf{T}\). The difference is substantial. The example assumes the LD reference correlation is otherwise a good estimate for the GWAS population; allele alignment alone cannot establish that.

A reference panel from another sample can be useful if its LD structure is sufficiently close to that of the GWAS sample. This is an assumption, not a consequence of having the same variant names. Differences in ancestry, allele frequencies, relatedness, imputation, or genotype processing can change the estimated correlations. The reference and GWAS must also represent the same adjustment and genotype scaling as far as the calculation requires. If covariates were adjusted for in the GWAS, raw genotype correlations from a reference may not equal the correlations among the adjusted genotypes.

The relation between summary effects and \(R\) is simplest when all variants’ marginal effects are estimated in the same individuals. If per-variant sample sizes differ because of missingness, or different variants were analyzed in different samples, there may be no single \(X^\mathsf{T}y/n\) vector and \(X^\mathsf{T}X/n\) matrix behind the supplied summaries. Treating the summaries as if there were can distort the joint estimates. Binary-trait GWAS and other non-linear or differently scaled analyses also require care: their reported coefficients do not automatically have the same scale as linear-regression effects for a standardized phenotype. Use coefficients and LD definitions that support the intended linear approximation; do not substitute \(z\)-statistics for effects without a justified conversion.

Interpretation and Common Pitfalls

The output is a vector of penalized joint-effect estimates under the chosen genotype and phenotype scale. It can supply weights for a score, but the ridge calculation itself does not establish how well that score predicts in a target population. The size of a weight depends on the phenotype units, genotype scaling, variant coding, LD input, and penalty convention. The same numerical \(\lambda\) should not be assumed to imply the same amount of shrinkage under a different objective normalization.

  • Using marginal effects as if they were joint weights. Correlated variants can tag one another. The ridge estimate uses \(R\) to account for this correlation, rather than treating each marginal coefficient as an isolated joint effect.
  • Ignoring allele orientation. A flipped allele changes the sign of its effect and the relevant LD correlations. Align effect alleles and transform the LD matrix consistently.
  • Assuming a reference panel is automatically compatible. Matching variant labels does not guarantee matching LD. Consider ancestry, genotype processing, sample composition, and covariate adjustment.
  • Mixing effect scales or penalty conventions. Per-allele effects, per-standard-deviation effects, and effects from differently normalized ridge objectives are not interchangeable without conversion.
Key takeaway: Summary-statistic ridge estimation solves \((R+\lambda I)\hat{\beta}=b_{\mathrm{marg}}\). Its practical reliability depends on whether the marginal effects and LD matrix describe the same aligned variants, coding, scale, and sufficiently compatible genetic structure.

Check Your Understanding

Check that you can connect the matrix calculation to the assumptions behind its inputs.

  1. Why do marginal effects generally differ from joint effects when variants are correlated?
  2. Under the stated ridge objective, what equation do the estimated effects satisfy?
  3. If one variant’s effect allele is flipped, what changes must be made to the LD matrix?
  4. Why might an LD matrix from a different ancestry be unsuitable even when it contains the same variant identifiers?
  5. What happens to the ridge estimate when \(R=I\), and how does \(\lambda\) affect each marginal effect?
Clinical Biostats