This function can be used to find an optimal correlation or partial correlation network according to extended BIC (EBIC; Foygel and Drton, 2010). The functions fitCovGraph
and fitConGraph
from the ggm package are used in computing these networks (Marchetti, Drton and Sadeghi, 2014).
findGraph(S, n, type = "cor", gamma = 0.5, method = c('stepup','stepdown','brute'),
reverseSteps = TRUE, startSig = TRUE)
A sample covariance or correlation matrix. Or a data frame, in which case cor_auto
will be used.
The sample size
"cor"
for estimating a correlation network or "pcor"
for estimating a partial correlation network
The EBIC tuning parameter
"brute"
for brute force search (testing all possible models), "stepup"
for stepwise up model search and "stepdown"
for stepwise down model search.
Logical. If method
is "stepup"
or "stepdown"
, should the stepping be reversed if a minimum is found? For example, if in stepwise up search a best model is found, should the search be continued by looking at if different edges could be deleted?
Logical. If TRUE
the initial model in if method
is "stepup"
or "stepdown"
is the model in which all edges that are insignificant using Holm adjustment are deleted. Otherwise, "stepup"
will start with an empty graph and "stepdown"
with a fully connected graph.
A (partial) correlation matrix
Due to the length of computing these models, EBICglasso
should be preferred in larger datasets.
Foygel, R., & Drton, M. (2010). Extended bayesian information criteria for gaussian graphical models. In Advances in Neural Information Processing Systems (pp. 604-612). Chicago
Giovanni M. Marchetti, Mathias Drton and Kayvan Sadeghi (2014). ggm: A package for Graphical Markov Models. R package version 2.0. http://CRAN.R-project.org/package=ggm