compareDAGs {BiDAG}R Documentation

Comparing two graphs

Description

This function compares one (estimated) graph to another graph (true graph), returning a vector of 8 values:

Usage

compareDAGs(egraph, truegraph, cpdag = FALSE, rnd = 2)

Arguments

egraph

an object of class graphNEL (package ‘graph’), representing the graph which should be compared to a ground truth graph or an ajacency matrix corresponding to the graph

truegraph

an object of class graphNEL (package ‘graph’), representing the ground truth graph or an ajacency matrix corresponding to this graph

cpdag

logical, if TRUE (FALSE by default) both graphs are first converted to their respective equivalence class (CPDAG); this affects SHD calculation

rnd

integer, rounding integer indicating the number of decimal places (round) when computing TPR, FPR, FPRn and FDR

Value

a named numeric vector 8 elements: SHD, number of true positive edges (TP), number of false positive edges (FP), number of false negative edges (FN), true positive rate (TPR), false positive rate (FPR), false positive rate normalized to the true number of edges (FPRn) and false discovery rate (FDR)

Examples

Asiascore<-scoreparameters("bde", Asia)
## Not run: 
eDAG<-orderMCMC(Asiascore)
compareDAGs(eDAG$DAG,Asiamat)

## End(Not run)

[Package BiDAG version 2.0.4 Index]