BAS version 1.1.0 introduces a truncated Beta-Binomial Prior distribution on the number of predictors included in a model, which is useful for the case. This corresponds to a Bernoulli prior on the inclusion indicators with a common parameter inclusion probability , and in turn is assigned a Beta prior distribution with parameters and , . The truncated point is so that .

For the example, below the number of predictors is constrained to be less than or equal to 8.

library(MASS)
library(MASS)
data(UScrime)
UScrime[,-2] = log(UScrime[,-2])
crime.bic =  bas.lm(y ~ ., data=UScrime, n.models=2^15, prior="BIC",
                     modelprior=tr.beta.binomial(1,1,8),
                     initprobs= "eplogp")
plot(crime.bic$size, crime.bic$postprobs)

The default method for sampling in “BAS” enumerates all models so that models with size > 8 have zero probability in the above example. Alternatively, we can use the method=”MCMC” to avoid sampling models with prior probability 0.

crime.bic =  bas.lm(y ~ ., data=UScrime, n.models=2^15, prior="BIC",
                     modelprior=tr.beta.binomial(1,1,8),
                     method="MCMC", MCMC.iterations=25000)
plot(crime.bic$size, crime.bic$postprobs)