Learn R Programming

BDgraph (version 2.23)

compare: Comparing the result

Description

With this function, we can check the performance of our methods and compare it with other alternative approaches.

Usage

compare( G, est, est2 = NULL, est3 = NULL, colnames = NULL, vis = FALSE )

Arguments

G
The adjacency matrix corresponding to the true graph in which $g_{ij}=1$ if there is a link between notes $i$ and $j$, otherwise $g_{ij}=0$. It also can be an object with S3 class "sim" from function
est
An adjacency matrix corresponding to an estimated graph. It also can be an object with S3 class "bdgraph" from function bdgraph or "select" (from huge packa
est2
An adjacency matrix corresponding to an estimated graph. It also can be an object with S3 class "bdgraph" from function bdgraph or "select" (from huge package).
est3
An adjacency matrix corresponding to an estimated graph. It also can be an object with S3 class "bdgraph" from function bdgraph or "select" (from huge package).
colnames
A character vector giving the column names for the result table.
vis
Visualize the true graph and estimated graph structures. The default is FALSE.

Value

  • True positiveThe number of correctly estimated links.
  • True negativeThe number of true non-existing links which is correctly estimated.
  • False positiveThe number of links which they are not in the true graph, but are incorrectly estimated.
  • False negativeThe number of links which they are in the true graph, but are not estimated.
  • Accuracythe number of true results (both true positives and true negatives) divided by the total number of true and false results.
  • Balanced F-scoreA weighted average of the "positive predictive" and "true positive rate". F-score value reaches its best value at 1 and worst score at 0.
  • Positive predictiveThe number of correctly estimated links divided by the total number of links in the estimated graph.
  • True positive rateThe number of correctly estimated links divided by the total number of links in the true graph.
  • False positive rateThe false positive value divided by the total number of links in the true graph.

References

Mohammadi, A. and E. Wit (2015). Bayesian Structure Learning in Sparse Gaussian Graphical Models, Bayesian Analysis, 10(1):109-138 Mohammadi, A. and E. Wit (2015). BDgraph: An R Package for Bayesian Structure Learning in Graphical Models, arXiv:1501.05108 Mohammadi, A., F. Abegaz Yazew, E. van den Heuvel, and E. Wit (2015). Bayesian Gaussian Copula Graphical Modeling for Dupuytren Disease, arXiv:1501.04849

See Also

bdgraph and select

Examples

Run this code
# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 6, size = 7, vis = TRUE )
   
# Running sampling algorithm based on GGM method 
output_ggm <- bdgraph( data = data.sim, method = "ggm", iter = 10000 )
# Comparing the result
compare( data.sim, output_ggm, colnames = c("true", "GGM"), vis = TRUE )
   
# Running sampling algorithm based on GCGM method 
output_gcgm <- bdgraph( data = data.sim, method = "gcgm", iter = 10000 )
# Comparing GGM and GCGM methods
compare( data.sim, output_ggm, output_gcgm, colnames = c("true", "GGM", "GCGM"), vis = TRUE )

Run the code above in your browser using DataLab