View source: R/EBICglasso.qgraph.R
| EBICglasso.qgraph | R Documentation | 
EBICglasso from qgraph 1.4.4This 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 criterion
(EBIC) described by Foygel & Drton (2010).
EBICglasso.qgraph(
  data,
  n = NULL,
  corr = c("auto", "cor_auto", "cosine", "pearson", "spearman"),
  na.data = c("pairwise", "listwise"),
  gamma = 0.5,
  penalize.diagonal = FALSE,
  nlambda = 100,
  lambda.min.ratio = 0.1,
  fast = FALSE,
  returnAllResults = FALSE,
  penalizeMatrix = NULL,
  countDiagonal = FALSE,
  refit = FALSE,
  model.selection = c("EBIC", "JSD"),
  verbose = FALSE,
  ...
)
| data | Matrix or data frame. Should consist only of variables to be used in the analysis | 
| n | Numeric (length = 1).
Sample size if  | 
| corr | Character (length = 1).
Method to compute correlations.
Defaults to  
 For other similarity measures, compute them first and input them
into  | 
| na.data | Character (length = 1).
How should missing data be handled?
Defaults to  
 | 
| gamma | Numeric (length = 1)
EBIC tuning parameter.
Defaults to  | 
| penalize.diagonal | Boolean (length = 1).
Should the diagonal be penalized?
Defaults to  | 
| nlambda | Numeric (length = 1).
Number of lambda values to test.
Defaults to  | 
| lambda.min.ratio | Numeric (length = 1).
Ratio of lowest lambda value compared to maximal lambda.
Defaults to  | 
| fast | Boolean (length = 1).
Whether the  The fast results may differ by less than floating point of the original
GLASSO implemented by  | 
| returnAllResults | Boolean (length = 1).
Whether all results should be returned.
Defaults to  | 
| penalizeMatrix | Boolean matrix. Optional logical matrix to indicate which elements are penalized | 
| countDiagonal | Boolean (length = 1).
Should diagonal be counted in EBIC computation?
Defaults to  | 
| refit | Boolean (length = 1).
Should the optimal graph be refitted without LASSO regularization?
Defaults to  | 
| model.selection | Character (length = 1).
How lambda should be selected within GLASSO.
Defaults to  | 
| verbose | Boolean (length = 1).
Whether messages and (insignificant) warnings should be output.
Defaults to  | 
| ... | Arguments sent to  | 
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.
A partial correlation matrix
Sacha Epskamp; for maintanence, Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen at gmail.com>
Instantiation of GLASSO 
Friedman, J., Hastie, T., & Tibshirani, R. (2008).
Sparse inverse covariance estimation with the graphical lasso.
Biostatistics, 9, 432-441.
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).
glasso package 
Friedman, J., Hastie, T., & Tibshirani, R. (2011).
glasso: Graphical lasso-estimation of Gaussian graphical models.
R package version 1.7.
Tutorial on EBICglasso 
Epskamp, S., & Fried, E. I. (2018).
A tutorial on regularized partial correlation networks.
Psychological Methods, 23(4), 617–634.
# Obtain data
wmt <- wmt2[,7:24]
# Fast
fast <- EBICglasso.qgraph(wmt)
# Regular
regular <- EBICglasso.qgraph(wmt, fast = FALSE)
# Difference between fast and regular
sum(abs(fast - regular))
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.