The BHAM package provides a scalable solution for fitting high-dimensional generalized additive model using spike-and-slab lasso priors or other regularized priors, including continuous spike-and-slab priors, Student’ T priors and double exponential priors. It fits linear, logistic, poisson and Cox regression models. The specification of the additive functions follows a popular syntax implemented in mgcv. An arsenal of facilitating functions are provided, including cross-validation, model summary, and visualization.

Getting Started

If you are new to BHAM we recommend starting with the vignettes


Install the latest development version from GitHub

if (!require(devtools)) {
devtools::install_github("boyiguo1/BHAM", build_vignettes = FALSE)

You can also set build_vignettes=TRUE but this will slow down the installation drastically (the vignettes can always be accessed online anytime at

We are currently streamlining the syntax of the package for better user experience. When we have a stable version, we will submit the package to CRAN. Please stay tuned!