qgraph (version 1.6.2)

findGraph: Search for optimal correlation or partial correlation network

Description

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).

Usage

findGraph(S, n, type = "cor", gamma = 0.5, method = c('stepup','stepdown','brute'), 
          reverseSteps = TRUE, startSig = TRUE)

Arguments

S

A sample covariance or correlation matrix. Or a data frame, in which case cor_auto will be used.

n

The sample size

type

"cor" for estimating a correlation network or "pcor" for estimating a partial correlation network

gamma

The EBIC tuning parameter

method

"brute" for brute force search (testing all possible models), "stepup" for stepwise up model search and "stepdown" for stepwise down model search.

reverseSteps

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?

startSig

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.

Value

A (partial) correlation matrix

Details

Due to the length of computing these models, EBICglasso should be preferred in larger datasets.

References

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