Learn R Programming

EGAnet (version 1.2.3)

EBICglasso.qgraph: EBICglasso from qgraph 1.4.4

Description

This function uses the glasso package (Friedman, Hastie and Tibshirani, 2011) to compute a sparse gaussian graphical model with the graphical lasso (Friedman, Hastie & Tibshirani, 2008). The tuning parameter is chosen using the Extended Bayesian Information criterium (EBIC) described by Foygel & Drton (2010).

Usage

EBICglasso.qgraph(
  data,
  n = NULL,
  gamma = 0.5,
  penalize.diagonal = FALSE,
  nlambda = 100,
  lambda.min.ratio = 0.1,
  returnAllResults = FALSE,
  penalizeMatrix,
  countDiagonal = FALSE,
  refit = FALSE,
  ...
)

Value

A partial correlation matrix

Arguments

data

Data matrix

n

Number of participants

gamma

EBIC tuning parameter. 0.5 is generally a good choice. Setting to zero will cause regular BIC to be used.

penalize.diagonal

Should the diagonal be penalized?

nlambda

Number of lambda values to test.

lambda.min.ratio

Ratio of lowest lambda value compared to maximal lambda. Defaults to 0.1. NOTE qgraph sets the default to 0.01

returnAllResults

If TRUE this function does not return a network but the results of the entire glasso path.

penalizeMatrix

Optional logical matrix to indicate which elements are penalized

countDiagonal

Should diagonal be counted in EBIC computation? Defaults to FALSE. Set to TRUE to mimic qgraph < 1.3 behavior (not recommended!).

refit

Logical, should the optimal graph be refitted without LASSO regularization? Defaults to FALSE.

...

Arguments sent to glasso

Author

Sacha Epskamp <mail@sachaepskamp.com>

Details

The glasso is run for 100 values of the tuning parameter logarithmically spaced between the maximal value of the tuning parameter at which all edges are zero, lambda_max, and lambda_max/100. For each of these graphs the EBIC is computed and the graph with the best EBIC is selected. The partial correlation matrix is computed using wi2net and returned.

References

# Instantiation of GLASSO
Friedman, J., Hastie, T., & Tibshirani, R. (2008). Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9, 432-441.

# Tutorial on EBICglasso Epskamp, S., & Fried, E. I. (2018). A tutorial on regularized partial correlation networks. Psychological Methods, 23(4), 617–634.

# glasso package
Friedman, J., Hastie, T., & Tibshirani, R. (2011). glasso: Graphical lasso-estimation of Gaussian graphical models. R package version 1.7.

# glasso + EBIC
Foygel, R., & Drton, M. (2010). Extended Bayesian information criteria for Gaussian graphical models. In Advances in neural information processing systems (pp. 604-612).

Examples

Run this code
# Obtain data
wmt <- wmt2[,7:24]

if (FALSE) {
# Compute graph with tuning = 0 (BIC)
BICgraph <- EBICglasso.qgraph(
  data = wmt, gamma = 0
)

# Compute graph with tuning = 0.5 (EBIC)
EBICgraph <- EBICglasso.qgraph(
  data = wmt, gamma = 0.5
)}

Run the code above in your browser using DataLab