compareGraphs: compareGraphs

Description Usage Arguments Details Value Author(s) Examples

Description

Given an original and inferred network, count number of true/false positives and negatives. Calculate sensitivity and specificity measures.

Usage

1
compareGraphs(phiorig,phi,ignore.type=FALSE)

Arguments

phiorig

Original graph. Stored as adjacency matrix.

phi

Inferred graph. Stored as adjaceny matrix.

ignore.type

Boolean. If TRUE, only compare edge abundance, if FALSE, also take into account the type of the edge for counting numbers of true and false edges.

Details

Counts the number of tp as: activations in phi and phiorig + inhibitions in phi and phiorig.
Counts the number of fp as: activations or inhibitions in phi and no edge in phiorig.
Counts the number of tn as: no edge in phi and no edge in phiorig.
Counts the number of fn as: no edge in phi and activation or inhibition in phiorig.

Value

Vector of comparison measures:

tp

True positives

fp

False positives

tn

True negatives

fn

False negatives

sn

Sensitivity: sn = tp/(tp+fn)

sp

Specificity: sp = tn/(tn+fp)

prec

Precision: prec = tp / (tp + fp)

f1

F1: 2*prec*sn / (prec + sn)

Author(s)

Christian Bender

Examples

1
2
3
4
5
6
7
## Not run: 
  library(ddepn)
  phi <- matrix(sample(c(0,1,2),9,replace=TRUE),nrow=3,ncol=3)
  phiorig <- matrix(sample(c(0,1,2),9,replace=TRUE),nrow=3,ncol=3)
  compareGraphs(phi,phiorig)

## End(Not run)

ddepn documentation built on May 2, 2019, 4:42 p.m.