beam {beam} | R Documentation |
Bayesian inference in large Gaussian graphical models
Description
This function carries out covariance and inverse covariance estimation within the Gaussian conjugate model. The scale matrix parameter of the inverse-Wishart is set to the identity (default), whereas the degree of freedom parameter is estimated by maximization of the marginal likelihood. The function also computes the Bayes factor and tail probability (p-values) to test the marginal or conditional independence between all pairs of variables.
Usage
beam(X, type = "conditional", return.only = c("cor", "BF", "prob"),
verbose=TRUE, D=NULL)
Arguments
X |
n by p data matrix |
type |
character. Either "marginal", "conditional" or "both". See Details. |
return.only |
character. Either "cor", "BF", "prob". See details. |
verbose |
logical. Whether information on progress should be be printed. |
D |
matrix. Prior marginal correlation matrix. Must be positive definite, well-conditioned and have unit variance. |
Details
The arguments type
and return.only
have essentially been introduced for computational and memory savings.
Using argument type
the user may indicate whether the marginal dependencies ("marginal"), the conditional dependencies ("conditional") or both ("both") are to be inferred. On the other hand, the argument return.only
is used to indicate whether the correlations ("cor"), Bayes factors ("BF") or tail probabilities ("prob") should be returned. Default is to return all three quantities for conditional dependencies.
Value
An object of class beam-class
Author(s)
Gwenael G.R. Leday and Ilaria Speranza
References
Leday, G.G.R. and Richardson, S. (2019). Fast Bayesian inference in large Gaussian graphical models. Biometrics.
Examples
# Load data
data(TCPAprad)
# beam
fit <- beam(X = TCPAprad, type="both")
# Print summary
summary(fit)
# Extract matrix of marginal correlations
mcor(fit)[1:5, 1:5]
# Extract matrix of partial correlations
pcor(fit)[1:5, 1:5]
# Plot log-marginal likelihood of the Gaussian conjugate model
plotML(fit)
# Plot heatmap of marginal (upper triangle) and/or
# partial (lower triangle) correlation estimates
plotCor(fit)