WOLFRAM|DEMONSTRATIONS PROJECT

How Receiver Operating Characteristic Curves Work

​

20
μ
30
FPR
Visually the ROC curve, shown in the top-right corner, is the shaded area under the right curve versus the shaded area under the left curve as the threshold parameter

varies. A more detailed explanation now follows.
Let
X
be a possible medical diagnostic for disease. For example,
X
, could be eye pressure and the disease could be glaucoma. We suppose that the distribution of
X
in healthy people is
N(20,5)
and in the diseased population it is
N(μ,6)
, where
μ>20
. These curves are shown on the left. The receiver operating characteristic (ROC) curve can be used to visualize and quantify how useful
X
is in the detection of this disease. We suppose that people are diagnosed healthy or diseased according as
X<
or
X≥
. In the above diagram, we show the case where
μ=30
and
=20
. The ROC curve plots sensitivity versus specificity, where
sensitivity=Pr{X≥|diseased}=purpleareainplot
,
specificity=Pr{X<|healthy}=blueareainplot
.
Keeping
μ
fixed, as we vary the threshold parameter,

, we trace out the ROC curve, shown in the upper-right corner. For any fixed value of

, the point shown on the ROC curve corresponds to the two shaded areas.
The usefulness of the test depends on
μ
. The larger
μ
is, the larger the difference between the normal and diseased populations and the easier it is to detect disease. So the diagnostic test improves if
μ
increases. The
AUC
or area under the ROC curve quantifies the usefulness of the test,
0<AUC<1
. Increasing
μ
increases the
AUC
. For large enough
μ
,
AUC≐1
. In our Demonstration,
AUC=0.5
when
μ=20
. In this case, the test is useless and is equivalent to simply random guessing. Obviously, when
μ<20
, the test,
X≥
, is worse than useless!
Sometimes the ROC curve is defined as the plot of FPR versus TPR, where FPR, the false positive rate, is defined as
FPR=1-specificity
and TPR is the true positive rate,
TPR=sensitivity
. Click the FPR checkbox to select this type of plot. In this plot,
FPR
is the area to the right of

for the healthy population and is shown as the colored area under the left curve. When this area overlaps with the curve of the diseased population on the right, the blended color is shown. Similarly TPR is the area to the right of

in the diseased population and is shown as the colored area under the right curve; once again the overlapping area is shown as the blended color.