bms {maclogp}R Documentation

Bayesian Model Confidence Set

Description

This function allows you to obtain a bayesian model confidence set with approximate posterior model probability.

Usage

bms(data, alpha, eps = 1e-06)

Arguments

data

a list including

x

covariates matrix, of dimension nobs and nvars;each row is an observation vector.

y

response variable.

alpha

a vector of significance levels. The confidence levels are 1-alpha. Default value is 0.05.

eps

toterance level in choosing models with total posteriors at least 1-alpha. Default value is 1e-6.

Value

Returns a list containing:

models

A list with one entry for each model. Each entry is an integer vector that specifies the columns of matrix x to be used as a regressor in that model. Models is ordered with decreasing posteriors.

con_sets

a list with with one entry for a 1-alpha model confidence set. Each entry is an integer vector that specifies the models selected in this set. The model indexes used in con_sets are their orders in models.

length_con

lengths of confidence sets.

probs_inorder

Model posteriors in decreasing order.

beta_ls

a list with one entry for each model. Each entry is a vector of estimated coefficients for that model.

References

Liu, X., Li, Y. & Jiang, J.(2020). Simple measures of uncertainty for model selection. TEST, 1-20.

Raftery, Adrian E. (1995). Bayesian model selection in social research (with Discussion). Sociological Methodology 1995 (Peter V. Marsden, ed.), pp. 111-196.

See Also

bic.glm

Examples

n= 50
B= 100
p= 5 
x = matrix(rnorm(n*p, mean=0, sd=1), n, p)
true_b = c(1:3, rep(0,p-3))
y = x%*% true_b+rnorm(n)
alpha=c(0.1,0.05,0.01)
data=list(x=x,y=y)
result=bms(data,alpha)

[Package maclogp version 0.1.1 Index]