Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

confint.coef

Compute Credible Intervals for BAS regression coefficients from BAS objects


Description

Uses Monte Carlo simulations using posterior means and standard deviations of coefficients to generate draws from the posterior distributions and returns highest posterior density (HPD) credible intervals. If the number of models equals one, then use the t distribution to find intervals. These currently condition on the estimate of $g$. than the description above ~~

Usage

## S3 method for class 'coef.bas'
confint(object, parm, level = 0.95, nsim = 10000, ...)

Arguments

object

a coef.bas object

parm

a specification of which parameters are to be given credible intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the probability coverage required

nsim

number of Monte Carlo draws from the posterior distribution. Used when number of models is greater than 1.

...

other arguments to passed; none currently

Value

A matrix (or vector) with columns giving lower and upper HPD credible limits for each parameter. These will be labeled as 1-level)/2 and 1 - (1-level)/2 in percent (by default 2.5 and 97.5).

Note

For mixture of g-priors these are approximate. This uses Monte Carlo sampling so results may be subject to Monte Carlo variation and larger values of nsim may be needed to reduce variability.

Author(s)

Merlise A Clyde

See Also

Other CI methods: confint.pred.bas(), plot.confint.bas()

Examples

data("Hald")
hald_gprior <-  bas.lm(Y~ ., data=Hald, alpha=13,
                            prior="g-prior")
coef_hald <- coef(hald_gprior)
confint(coef_hald)
confint(coef_hald, approx=FALSE, nsim=5000)
# extract just the coefficient of X4
confint(coef_hald, parm="X4")

BAS

Bayesian Variable Selection and Model Averaging using Bayesian Adaptive Sampling

v1.5.5
GPL (>= 3)
Authors
Merlise Clyde [aut, cre, cph] (ORCID=0000-0002-3595-1872), Michael Littman [ctb], Quanli Wang [ctb], Joyee Ghosh [ctb], Yingbo Li [ctb], Don van de Bergh [ctb]
Initial release
2020-1-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.