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,
  methodArgs = BglrOptions()
)

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.

methodArgs

Options forwarded to BGLR::BGLR, built with BglrOptions. A bare list is refused: it cannot be checked against the engine, so a misspelled option would be silently ignored.

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.019809234 -0.013534960  0.016049637  0.001015008
#>  [6] -0.004879630  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.018357101 -0.018154269 -0.026808573
#> [21] -0.007700331  0.029143815  0.003007443  0.004684268 -0.013930866
#> [26]  0.008177709 -0.032411770 -0.004081020 -0.007865471  0.002642256