Learn R Programming

interventionalDBN (version 1.2.2)

linesROC: Add an ROC curve to an existing plot.

Description

A simple function to produce an ROC curve from a known edge matrix and a posterior edge probability matrix.

Usage

linesROC(trueMatrix, pep, col = "red", lty = 1, lwd = 1)

Arguments

trueMatrix
The 'true' edge matrix.
pep
A matrix of posterior edge probabilities.
col
A colour (passed to segments).
lty
A line type (passed to segments).
lwd
A line width (passed to segments).

Value

Details

The area of the ROC curve is also sent to the console.

See Also

interventionalDBN-package

Examples

Run this code
trueMatrix<-matrix(rbinom(225,1,0.5),15,15)
pep<-matrix(runif(225,0.2,1)*trueMatrix+runif(225,0,0.5)*(1-trueMatrix),15,15)
plot(0:1, 0:1, t="l", col="grey", xlab="False positive rate",
  ylab="False negative rate", main="An ROC curve.")
linesROC(trueMatrix,pep)

Run the code above in your browser using DataLab