Skip to contents

Fits a BayesB linear regression model via `BGLR::BGLR` and returns the posterior mean of the marker effects. BayesB places a "spike-and-slab" mixture prior on each marker effect, with a scaled-t slab.

Usage

bayesBWeights(X, y, nIter = 10000, burnIn = 2000, thin = 5, probIn = 0.2, ...)

Arguments

X

A numeric matrix of predictors.

y

A numeric response vector.

nIter

Number of MCMC iterations. Default is 10000.

burnIn

Number of burn-in iterations. Default is 2000.

thin

Thinning interval. Default is 5.

probIn

Prior inclusion probability for each marker. Default is 0.2.

...

Additional arguments passed through to `BGLR::BGLR`.

Value

A numeric vector of length `ncol(X)` of variant weights.

Details

Defaults for `nIter`, `burnIn`, and `thin` are larger than BGLR's package defaults to better accommodate the high LD typical of cis-eQTL windows; see Kim et al. (2022) which observed that the BGLR defaults can be inadequate under correlated predictors. Override these arguments to recover the package defaults if desired.

Examples

data(eqtlRegionExample)
X <- eqtlRegionExample$X[, 1:30]
y <- eqtlRegionExample$yRes
bayesBWeights(X, y)
#>  [1]  0.008513107 -0.019809233 -0.013534959  0.016049637  0.001015008
#>  [6] -0.004879629  0.010223836  0.032196557  0.010073229  0.023607511
#> [11] -0.009656029 -0.004891710  0.036881400  0.017463816  0.002507651
#> [16] -0.007128508  0.005943798 -0.018357100 -0.018154269 -0.026808573
#> [21] -0.007700330  0.029143815  0.003007443  0.004684268 -0.013930866
#> [26]  0.008177709 -0.032411770 -0.004081019 -0.007865472  0.002642256