itercomp {BiDAG}R Documentation

Performance assessment of iterative MCMC scheme against a known Bayesian network


This function compute 8 different metrics of structure fit of an object of class iterativeMCMC to the ground truth DAG (or CPDAG). Object of class iterativeMCMC stores MAP graph at from each search space expansion step. This function computes structure fit of each of the stored graphs to the ground truth one. Computed metrics include: TP, FP, TPR, FPR, FPRn, FDR, SHD. See metrics description in see also compareDAGs.


itercomp(MCMCmult, truedag, cpdag = TRUE, p = 0.5, trans = TRUE)

## S3 method for class 'itercomp'
plot(x, ..., vars = c("FP", "TP"), type = "b", col = "blue", showit = c())

## S3 method for class 'itercomp'
print(x, ...)

## S3 method for class 'itercomp'
summary(object, ...)



an object which of class iterativeMCMC, see also iterativeMCMC)


ground truth DAG which generated the data used in the search procedure; represented by an object of class graphNEL or an adjacency matrix


logical, if TRUE (FALSE by default) all DAGs are first converted to their respective equivalence classes (CPDAG)


threshold such that only edges with a higher posterior probability will be retained in the directed graph summarising the sample of DAGs at each iteration from MCMCmult if parameter sample set to TRUE


logical, for DBNs indicates if model comparions are performed for transition structure; when trans equals FALSE the comparison is performed for initial structures of estimated models and the ground truth DBN; for usual BNs the parameter is disregarded


object of class 'itercomp'




a tuple of variables which will be used for 'x' and 'y' axes; possible values: "SHD", "TP", "FP", "TPR", "FPR", "FPRn", "FDR", "score"


type of line in the plot;"b" by default


colour of line in the plot; "blue" by default


(optional) vector of integers specifying indices of search expansion iterations to be labelled; by default no iterations are labelled


object of class 'itercomp'


an object if class itersim, a matrix with the number of rows equal to the number of expansion iterations in iterativeMCMC, and 8 columns reporting for the maximally scoring DAG uncovered at each iteration: the number of true positive edges ('TP'), the number of false positive edges ('FP'), the true positive rate ('TPR'), the structural Hamming distance ('SHD'), false positive rate ('FPR'), false discovery rate ('FDR') and the score of the DAG (‘score’).


Polina Suter


gsim.score<-scoreparameters("bge", gsim)
## Not run: 
itercomp(MAPestimate, gsimmat)

## End(Not run)

[Package BiDAG version 2.0.4 Index]