confusion {causalDisco} R Documentation

## Compute confusion matrix for comparing two adjacency matrices

### Description

Two adjacency matrices are compared either in terms of adjacencies (type = "adj") or orientations (type = "dir").

### Usage

confusion(est_amat, true_amat, type = "adj")


### Arguments

 est_amat The estimated adjacency matrix true_amat The true adjacency matrix type String indicating whether the confusion matrix should be computed for adjacencies ("adj", the default) or for (conditional) orientations (dir).

### Details

In the former case, the confusion matrix is a cross-tabulation of adjacencies.

In the latter case, the orientation confusion matrix is conditional on agreement on adjacency. This means that only adjacencies that are shared in both input matrices are considered, and agreement wrt. orientation is then computed only among these edges that occur in both matrices. A true positive is a correctly placed arrowhead (1), a false positive marks placement of arrowhead (1) where there should have been a tail (0), a false negative marks placement of tail (0) where there should have been an arrowhead (1), and a true negative marks correct placement of a tail (0).

### Value

A list with entries $tp (number of true positives), $tn (number of true negatives), $fp (number of false positives), and $tp (number of false negatives).

[Package causalDisco version 0.9.1 Index]