Extract weights from lassosumRss with shrinkage grid search
Source:R/regularizedRegressionWrappers.R
lassosumRssWeights.RdSearches over a grid of shrinkage parameters s (default:
c(0.2, 0.5, 0.9, 1.0), matching the original lassosum and OTTERS).
For each s, the LD matrix is shrunk as (1-s)*R + s*I, then
lassosumRss() is called across the lambda path. Candidate selection
defaults to the LD-only quadratic pseudovalidation score
$$\frac{c^T \beta}{\sqrt{\beta^T R \beta}}$$
evaluated on the supplied LD matrix R. This uses the same candidate
beta path as lassosumRss(), but scores each candidate directly from
summary-statistics correlation c and LD, without requiring genotype.
Arguments
- stat
A list with
$b(effect sizes) and$n(per-variant sample sizes).- LD
LD correlation matrix R (single matrix, NOT pre-shrunk).
- s
Numeric vector of shrinkage parameters to search over. Default:
c(0.2, 0.5, 0.9, 1.0)following Mak et al (2017) and OTTERS.- selection
Selection strategy. Default
"ld_quadratic"uses \(c^T \beta / \sqrt{\beta^T R \beta}\) on the supplied LD matrix."min_fbeta"is retained as an explicit alternative for debugging.- ...
Additional arguments passed to
lassosumRss().
Details
The original lassosum pseudovalidation can be written as an LD quadratic
score after centering and standardizing the reference matrix columns by the
same per-variant scale:
$$\mathrm{score}(\beta) = \frac{c^T \beta}{\sqrt{\beta^T R \beta}}.$$
This implementation therefore uses the supplied LD matrix directly for
selection. min(fbeta) is retained only as an explicit debug option.
Examples
data(eqtlRegionExample)
X <- eqtlRegionExample$X[, 1:30]
y <- eqtlRegionExample$yRes
ss <- lapply(
seq_len(ncol(X)), function(j) coef(summary(lm(y ~ X[, j])))[2, 1:2])
stat <- list(
b = vapply(ss, `[`, numeric(1), 1L),
seb = vapply(ss, `[`, numeric(1), 2L),
n = rep(nrow(X), ncol(X))
)
LD <- cor(X)
lassosumRssWeights(stat, LD)
#> [1] -0.048438809 -0.048206629 -0.022924444 0.005719588 0.005359918
#> [6] -0.021442722 -0.016361411 0.030889502 0.009735165 0.009741973
#> [11] -0.017352850 -0.037738304 -0.028743496 0.000000000 -0.016995314
#> [16] 0.030671213 0.005594169 0.007675219 0.092565548 0.007598779
#> [21] 0.007513403 -0.021638059 0.007510310 -0.015755868 -0.028776244
#> [26] -0.021473335 -0.111441982 -0.028776116 0.092847617 0.022980710
#> attr(,"lassosum_selection")
#> mode index s lambda
#> "ld_quadratic" "1" "0.2" "1e-04"