Compute SCAD-Penalized Weights from Summary Statistics
Source:R/regularizedRegressionWrappers.R
scadRssWeights.RdFits SCAD-penalized regression on the RSS objective, searching over a
shrinkage grid s and lambda path. Model selection uses LD-quadratic
pseudovalidation by default.
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 LD shrinkage parameters. Default:
c(0.2, 0.5, 0.9, 1.0).- gamma
SCAD concavity parameter. Default 3.7.
- alpha
Elastic-net mixing (1 = pure L1). Default 1.
- selection
Selection strategy:
"ld_quadratic"(default) or"min_fbeta".- ...
Additional arguments passed to
penalizedRss().
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)
scadRssWeights(stat, LD)
#> [1] -0.048565027 -0.048563995 -0.023504257 0.005937847 0.006035339
#> [6] -0.022037522 -0.016458707 0.030890109 0.009653341 0.009390947
#> [11] -0.017635699 -0.037745517 -0.029085130 0.000000000 -0.017680721
#> [16] 0.030919611 0.005418932 0.007347711 0.092705318 0.007547093
#> [21] 0.007911081 -0.021719584 0.008182288 -0.016166490 -0.028844757
#> [26] -0.021718775 -0.111457739 -0.028777774 0.093059199 0.023114605
#> attr(,"penalized_rss_selection")
#> mode index penalty
#> "ld_quadratic" "8" "SCAD"
#> s lambda
#> "0.2" "0.00127427498570313"