﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
1350	ROC curve	Jorge	Pedro Gea	"The ROC curve is widely used in the diagnosis of qualitative response models.

In [http://en.wikipedia.org/wiki/Receiver_operating_characteristic ROC (Wikipedia)] we can find the definition.

We request the inclusion of this function and other derived values, such as Area Under Curve (AUC) in a TOL package. Consider also an implementation in C++ because its performance could impact when it is used with big models or when it should be invoked repeatedly from other computations such as ""DUETO"" decomposition.

Below is an implementation done in TOL (thanks to pgea and cgarcia):

{{{
#!java
//////////////////////////////////////////////////////////////////////////////
Real ROC.AUC(Matrix real, Matrix prediction) // by columns
//////////////////////////////////////////////////////////////////////////////
{
  Set steps = Sort(MatSet(Tra(prediction))[1], Compare);
  Real length = Rows(real);
  Real RP = MatSum(real);
  Real RN = length-RP;
  Real FFP = 1;
  Real AUC = 0;
  Set EvalSet(steps, Real (Real step) {
    Real FFP0 = FFP;
    Matrix mc = GE(prediction, step);
    Matrix mFP = mc $* Not(real);
    Real FP = MatSum(mFP);
    Real FFP := FP/RP;
    Real If(FFP<FFP0, {
      Matrix mVP = mc $* real;
      Real VP = MatSum(mVP);
      Real FVP = VP/RN;
      Real AUC := AUC - FVP*(FFP-FFP0);
    1});
  1});
  AUC
};
}}} "	task	closed	high	Numerical methods	Kernel	head	critical	fixed		pgea@… atorre@…
