baygel

Overview

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

Installation

You can install the latest version from CRAN using:

install.packages("baygel")

Loading

library(baygel)

Simple example

library(baygel)

# 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)
posterior     <- blockBSGR(X,iterations = 1000, burnIn = 500)