Skip to contents

Computes specificity from two PDAG caugi::caugi objects. It converts the caugi::caugi objects to adjacency matrices and computes specificity as TN/(TN + FP), where TN are truth negatives and FP are false positives. If TN + FP = 0, 1 is returned. Only supports caugi::caugi objects with these edge types present -->, <-->, --- and no edge.

Usage

specificity(truth, est, type = c("adj", "dir"))

Arguments

truth

A caugi::caugi object representing the truth graph.

est

A caugi::caugi object representing the estimated graph.

type

Character string specifying the comparison type:

  • "adj": adjacency comparison.

  • "dir": orientation comparison conditional on shared adjacencies.

Value

A numeric in [0,1].

Examples

cg1 <- caugi::caugi(A %-->% B + C)
cg2 <- caugi::caugi(B %-->% A + C)
specificity(cg1, cg2, type = "adj")
#> [1] 0
specificity(cg1, cg2, type = "dir")
#> [1] 0