The baygel R
package provides
data-augmented block Gibbs samplers to return the posterior distribution
of precision matrices for Gaussian distributed data with
positive definite covariance matrix. The package is implemented
within the following literature, including Smith et al. (2022)
and Smith et
al. (2023).
You can install the latest version from CRAN using:
install.packages("baygel")
library(baygel)
library(baygel)
# Generate true covariance matrix:
<- 10
p <- 50
n <- pracma::Toeplitz(c(0.7^rep(1:p-1)))
SigTrue <- pracma::inv(SigTrue)
CTrue # Generate expected value vector:
<- rep(0,p)
mu # Generate multivariate normal distribution:
set.seed(123)
<- MASS::mvrnorm(n,mu=mu,Sigma=SigTrue)
X <- blockBSGR(X,iterations = 1000, burnIn = 500) posterior