Title: | Adaptive Bayesian Graphical Lasso |
Version: | 0.1.1 |
Description: | Implements a Bayesian adaptive graphical lasso data-augmented block Gibbs sampler. The sampler simulates the posterior distribution of precision matrices of a Gaussian Graphical Model. This sampler was adapted from the original MATLAB routine proposed in Wang (2012) <doi:10.1214/12-BA729>. |
License: | GPL-3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.1.1.9000 |
Imports: | MASS, pracma, stats, statmod |
Suggests: | testthat |
NeedsCompilation: | no |
Packaged: | 2021-07-13 08:43:20 UTC; QXZ0GWG |
Author: | Jarod Smith |
Maintainer: | Jarod Smith <jarodsmith706@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2021-07-13 22:10:05 UTC |
Adaptive Bayesian graphical lasso MCMC sampler
Description
A Bayesian adaptive graphical lasso data-augmented block Gibbs sampler. The sampler is adapted from the MATLAB routines used in Wang (2012).
Usage
BayesGlassoBlock(X, burnin = 1000, nmc = 2000)
Arguments
X |
Numeric matrix. |
burnin |
An integer specifying the number of burn-in iterations. |
nmc |
An integer specifying the number of MCMC samples. |
Value
list containing:
- Sig
A
p
byp
bynmc
array of saved posterior samples of covariance matrices.- Omega
A
p
byp
by nmc array of saved posterior samples of precision matrices.- Lambda
A 1 by
nmc
vector of saved posterior samples of lambda values.
References
Wang, H. (2012). Bayesian graphical lasso models and efficient posterior computation. Bayesian Analysis, 7(4). doi: 10.1214/12-BA729.
Examples
# Generate true covariance matrix:
p <- 10
n <- 50
SigTrue <- pracma::Toeplitz(c(0.7^rep(1:p-1)))
CTrue <- pracma::inv(SigTrue)
# Generate expected value vector:
mu <- rep(0,p)
# Generate multivariate normal distribution:
set.seed(123)
X <- MASS::mvrnorm(n,mu=mu,Sigma=SigTrue)
abglasso_post <- BayesGlassoBlock(X,burnin = 1000,nmc = 2000)