Skip to contents

Coordinate descent to solve the penalized regression on summary statistics: $$f(\beta) = \beta' R \beta - 2\beta' r + 2\lambda ||\beta||_1$$ where \(R\) is the LD matrix (pre-shrunk if desired) and \(r = \hat\beta / \sqrt{n}\).

Usage

lassosum_rss(
  bhat,
  LD,
  n,
  lambda = exp(seq(log(0.001), log(0.1), length.out = 20)),
  thr = 1e-04,
  maxiter = 10000
)

Arguments

bhat

A vector of marginal effect sizes.

LD

A list of LD blocks, where each element is a matrix representing an LD block. If shrinkage is desired, apply it before passing (e.g., (1-s)*R + s*I).

n

Sample size of the GWAS.

lambda

A vector of L1 penalty values. Default: 20 values from 0.001 to 0.1 on log scale.

thr

Convergence threshold. Default: 1e-4.

maxiter

Maximum number of iterations. Default: 10000.

Value

A list containing:

beta_est

Posterior estimates of SNP effect sizes at best lambda.

beta

Matrix of estimates (p x nlambda).

lambda

The lambda values used.

conv

Convergence indicators (1 = converged).

loss

Quadratic loss at each lambda.

fbeta

Full objective value at each lambda.

nparams

Number of non-zero coefficients at each lambda.

Details

Based on Mak et al (2017) "Polygenic scores via penalized regression on summary statistics", Genetic Epidemiology 41(6):469-480.

Examples

set.seed(42)
p <- 10
n <- 100
bhat <- rnorm(p, sd = 0.1)
R <- diag(p)
for (i in 1:(p - 1)) {
  R[i, i + 1] <- 0.3
  R[i + 1, i] <- 0.3
}
LD <- list(blk1 = R)
out <- lassosum_rss(bhat, LD, n)