EBICglasso.qgraph {EGAnet} | R Documentation |
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 criterion
(EBIC) described by Foygel & Drton (2010).
Usage
EBICglasso.qgraph(
data,
n = NULL,
corr = c("auto", "cor_auto", "pearson", "spearman"),
na.data = c("pairwise", "listwise"),
gamma = 0.5,
penalize.diagonal = FALSE,
nlambda = 100,
lambda.min.ratio = 0.1,
returnAllResults = FALSE,
penalizeMatrix,
countDiagonal = FALSE,
refit = FALSE,
model.selection = c("EBIC", "JSD"),
verbose = FALSE,
...
)
Arguments
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
|
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 |
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 |
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.
Value
A partial correlation matrix
Author(s)
Sacha Epskamp; for maintanence, Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen at gmail.com>
References
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.
Examples
# Obtain data
wmt <- wmt2[,7:24]
# 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)