Skip to contents

Function to include prior information via Zellner-style spike and slab prior for generalized linear models used in engine_breg. These priors are similar to the horseshoe priors used in regularized engine_stan models and penalize regressions by assuming most predictors having an effect of 0.


BREGPrior(variable, hyper = NULL, ip = NULL)

# S4 method for character,ANY,ANY



A character matched against existing predictors.


A numeric estimate of the mean regression coefficients.


A numeric estimate between 0 and 1 of the inclusion probability of the target variable (Default: NULL).


The Zellner-style spike and slab prior for generalized linear models are specified as described in the Boom R-package. Currently supported are two options which work for models with Poisson and binomial (Bernoulli) distributed errors. Two types of priors can be provided on a variable:

  • "coefficient" Allows to specify Gaussian priors on the mean coefficients of the model. Priors on the coefficients can be provided via the "hyper" parameter. Note that variables with such a prior can still be regularized out from the model.

  • "inclusion.probability" A vector giving the prior probability of inclusion for the specified variable. This can be useful when prior information on preference is known but not the strength of it.

If coefficients are set, then the inclusion probability is also modified by default. However even when not knowing a particular estimate of a beta coefficients and their direction, one can still provide an estimate of the inclusion probability. In other words: The hyperparameters 'hyper' and 'ip' can't be both NULL.


  • Hugh Chipman, Edward I. George, Robert E. McCulloch, M. Clyde, Dean P. Foster, Robert A. Stine (2001), "The Practical Implementation of Bayesian Model Selection" Lecture Notes-Monograph Series, Vol. 38, pp. 65-134. Institute of Mathematical Statistics.


if (FALSE) {
# Positive coefficient
p1 <- BREGPrior(variable = "forest", hyper = 2, ip = NULL)
# Coefficient and direction unknown but variable def. important
p2 <- BREGPrior(variable = "forest", hyper = NULL, ip = 1)