Compute Monte Carlo estimates of credible intervals for coefficients in the fitted variable selection model. This function is used by summary.varbvs to generate credible intervals for coefficients of top-ranked variables.

varbvscoefcred (fit, vars, cred.int = 0.95, nr = 1000)

Arguments

fit

Output of function varbvs.

vars

Vector of indices or names of variables. If not specified, credible intervals are computed for all variables.

cred.int

Size of credible interval (number between 0 and 1).

nr

Number of Monte Carlo samples to draw to estimate credible intervals. Amore accurate estimate of the credible interval can be obtained by setting nr to a larger number, at the cost of increased computation time.

Details

Here, the credible interval [a,b] is simply defined as a = quantile(x,0.5 - cred.int/2) and b = quantile(x,0.5 + cred.int/2), in which x is a vector of samples drawn from the posterior distribution.

Value

a

Credible interval lower bounds.

b

Credible interval upper bounds.

References

P. Carbonetto and M. Stephens (2012). Scalable variational inference for Bayesian variable selection in regression, and its accuracy in genetic association studies. Bayesian Analysis 7, 73--108.

See also

varbvs, summary.varbvs