This function calculates the number of true and false positives, the true positive rate, the structural Hamming distance and score for each iteration in the search procedure implemented in the function iterativeMCMC.
iterations.check(MCMCmult, truedag, cpdag = TRUE, p = 0.5, trans = TRUE)an object which of class MCMCmult (output of the function iterativeMCMC, see also MCMCmult)
ground truth DAG which generated the data used in the search procedure; represented by an object of class graphNEL
logical, if TRUE (FALSE by default) all DAGs in the MCMCmult are first converted to their respective equivalence class (CPDAG) before the averaging if parameter sample set to TRUE
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
A matrix with the number of rows equal to the number of elements in MCMCmult, and 5 columns reporting for
the maximally scoring DAG uncovered at each iteration (or for a summary over the sample of DAGs if sample parameter set to TRUE)
the number of true positive edges (`TP'), the number of false positive edges (`FP'),
the true positive rate (`TPR'), the structural Hamming distance (`SHD') and the score of the DAG (`score').
Note that the maximum estimated DAG as well as the true DAG are first converted to
the corresponding equivalence class (CPDAG) when calculating the SHD.
# NOT RUN {
gsim.score<-scoreparameters("bge", gsim)
# }
# NOT RUN {
MAPestimate<-iterativeMCMC(gsim.score)
iterations.check(MAPestimate, gsimmat)
# }
Run the code above in your browser using DataLab