fdr: False Discovery Rate

View source: R/metrics.R

fdrR Documentation

False Discovery Rate

Description

Computes false discovery rate from two PDAG caugi::caugi objects. It converts the caugi::caugi objects to adjacency matrices and computes false discovery rate as FP/(FP + TP), where FP are false positives and TP are true positives. If FP + TP = 0, 1 is returned.

Only supports caugi::caugi objects whose edges are restricted to ⁠-->⁠, ⁠<->⁠, ⁠---⁠, or absence of an edge.

Usage

fdr(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].

See Also

Other metrics: confusion(), evaluate(), f1_score(), false_omission_rate(), g1_score(), npv(), precision(), recall(), reexports, specificity()

Examples

cg1 <- caugi::caugi(A %-->% B + C)
cg2 <- caugi::caugi(B %-->% A + C)
fdr(cg1, cg2, type = "adj")
fdr(cg1, cg2, type = "dir")


causalDisco documentation built on April 13, 2026, 5:06 p.m.