Credible interval [a,b] is defined as smallest interval containing x0
that contains cred.int of the probability mass. Note that the credible
interval is not necessarily symmetric about x0. (Other definitions of the
credible interval are possible.)
The algorithm is quadratic in the length of x (and w), so should not be
used for large numbers of samples.
References
P. Carbonetto and M. Stephens (2012). Scalable variational
inference for Bayesian variable selection in regression, and its
accuracy in genetic association studies. Bayesian Analysis7,
73--108.