Skip to contents

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 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

Merlise A Clyde

Examples



data("Hald")
hald_gprior <-  bas.lm(Y~ ., data=Hald, alpha=13,
                            prior="g-prior")
coef_hald <- coef(hald_gprior)
confint(coef_hald)
#>                2.5%      97.5%       beta
#> Intercept 93.899749 96.9469774 95.4230769
#> X1         0.000000  1.8451082  1.2150202
#> X2        -1.114669  0.8562203  0.2756235
#> X3        -1.508182  0.5533747 -0.1270575
#> X4        -1.716110  0.2007243 -0.3268710
#> attr(,"Probability")
#> [1] 0.95
#> attr(,"class")
#> [1] "confint.bas"
confint(coef_hald, approx=FALSE, nsim=5000)
#>                2.5%      97.5%       beta
#> Intercept 93.940456 96.9940631 95.4230769
#> X1         0.000000  1.8753303  1.2150202
#> X2        -1.201605  0.8338886  0.2756235
#> X3        -1.538660  0.5621008 -0.1270575
#> X4        -1.762790  0.2190579 -0.3268710
#> attr(,"Probability")
#> [1] 0.95
#> attr(,"class")
#> [1] "confint.bas"
# extract just the coefficient of X4
confint(coef_hald, parm="X4")
#>        2.5%     97.5%      beta
#> X4 -1.69165 0.2614025 -0.326871
#> attr(,"Probability")
#> [1] 0.95
#> attr(,"class")
#> [1] "confint.bas"