itercomp {BiDAG}R Documentation

Performance assessment of iterative MCMC scheme against a known Bayesian network

Description

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.

Usage

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

Arguments

MCMCmult

an object which of class iterativeMCMC, see also iterativeMCMC)

truedag

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

cpdag

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

p

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

trans

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

x

object of class 'itercomp'

...

ignored

vars

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

type

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

col

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

showit

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

object

object of class 'itercomp'

Value

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

Author(s)

Polina Suter

Examples

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

## End(Not run)

[Package BiDAG version 2.1.4 Index]