unifPrior
implements a uniform prior (equal a priori probability for all
models). binomPrior
implements a Binomial prior.
bbPrior
implements a Beta-Binomial prior.
unifPrior(sel, logscale=TRUE, groups=1:length(sel),
constraints=lapply(1:length(unique(groups)), function(z) integer(0)))binomPrior(sel, prob=.5, logscale=TRUE, probconstr=prob, groups=1:length(sel),
constraints=lapply(1:length(unique(groups)), function(z) integer(0)))
bbPrior(sel, alpha=1, beta=1, logscale=TRUE, alphaconstr=alpha,
betaconstr=beta, groups=1:length(sel),
constraints=lapply(1:length(unique(groups)), function(z) integer(0)))
Prior probability of the specified model
Logical vector indicating which variables are included in the model
Set to TRUE
to return the log-prior
probability.
Group that each variable belongs to (e.g. dummy indicators for categorical variables with >2 categories). The idea is that all variables in a group are jointly added/removed from the model. By default all variables are assumed to be in separate groups
List with length equal to the number of groups
(distinct elements in groups
). Element j in the list should
indicate any hierarchical constraints on the group, for instance
constraints[[3]]==c(1,2) indicates that group 3 can only be included
in the model if groups 1 and 2 are also in the model. This can be used
to enforce that an interaction can only be in the model if the main
effects are also in the model.
Success probability for the Binomial prior
Success probability for the Binomial prior for groups that are subject to constraints
First parameter of the Beta-Binomial prior, which is equivalent
to specifying a Beta(alpha,beta) prior on prob
.
First parameter of the Beta-Binomial prior, which is equivalent
to specifying a Beta(alpha,beta) prior on prob
.
Same as alpha for the groups that are subject to constraints
Same as beta for the groups that are subject to constraints
David Rossell
library(mombf)
sel <- c(TRUE,TRUE,FALSE,FALSE)
unifPrior(sel,logscale=FALSE)
binomPrior(sel,prob=.5,logscale=FALSE)
bbPrior(sel,alpha=1,beta=1,logscale=FALSE)
Run the code above in your browser using DataLab