I have two distributions p1 and p2 (generating in R using distr package), and I want to compute the area under the ROC curve. To construct the ROC curve, I have to compute the probability of detection $p_D = \int_{T}^{\infty}{p2}$ and the probability of false alarm $p_{FA} = \int_{T}^{\infty}{p1}$ for each threshold T. Thus, for each threshold T, I have a point ($p_{FA}$, $p_{D}$) in the ROC curve. Then, from these points, I can compute the area under the curve. I ask if there is a direct way (function in R or other) to compute the area under the ROC curve using p1 and p2 distributions?
1 Answer
Yes, have a look on the pROC package.
You can create a roc
object with the function roc
, the AUC is computed by default.