Learn R Programming

BDgraph (version 2.19)

compare: Comparing the result

Description

With this function, we can check the performance of our method 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 "simulate" 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
Logical: if TRUE you will see a plot result. 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 preprint arXiv:1501.05108v2 Mohammadi, A., F. Abegaz Yazew, E. van den Heuvel, and E. Wit (2015). Bayesian Modeling of Dupuytren Disease Using Gaussian Copula Graphical Models, Arxiv preprint arXiv:1501.04849v2

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
output <- bdgraph( data = data.sim, iter = 10000 )
# comparing the result
compare( data.sim, output, colnames = c("true", "BDgraph"), vis = TRUE )

# estimate the true graph by 'huge' package
require( huge )  
huge.g <- huge( data.sim $ data, method = "mb" )
huge.g <- huge.select( huge.g )    

# comparing the result
compare( data.sim, output, huge.g, colnames = c("true", "BDgraph", "huge") , vis = TRUE )

Run the code above in your browser using DataLab