% [C,T,A] = roc(Y,P) ROC curve
%
% Curve of values (fp,tp) for a classifier (false and true positive rates).
% Note that for a finite dataset (i.e., finite N) the "curve" only exists at
% at most N points in the plane.
%
% In:
%   Y: Nx1 list of N ground-truth labels (in 1:2).
%   P: Nx1 matrix of posterior probabilities for class 1, p(C=1|X(n)) in [0,1].
% Out:
%   C: Nx2 array containing the curve as (fp,tp) pairs.
%   T: Nx1 list of threshold values in [0,1] at which the curve is defined.
%   A: scalar, area under the curve (AUC).

function [C,T,A] = roc(Y,P)

