Coder Social home page Coder Social logo

matlabauc's People

Contributors

brian-lau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matlabauc's Issues

ROC and ties, handled correctly?

Hi Brian,

Thanks for your code. It works nicely, though I have the feeling that the ROC curve is not calculated correctly when there are ties. The following example should demonstrate that.

[xx,yy]=roc([-1 1; 1 2; -1 3; -1 4; 1 5; -1 6; 1 7; -1 8; 1 9; 1 10; 1 11; -1 13; 1 13; 1 14; 1 14])

yields:

     0
0.1111
0.2222
0.4444
0.5556
0.6667
0.6667
0.7778
0.7778
0.8889
0.8889
0.8889
1.0000
1.0000
1.0000

yy =

     0
     0
0.1667
0.1667
0.1667
0.1667
0.3333
0.3333
0.5000
0.5000
0.6667
0.8333
0.8333
1.0000
1.0000

Manually doing this exercise, it's easy to show that the first non-zero value should be 0.2222 not 0.1111 (2 out of 9 signals are seen when no non-signals are detected yet). This is what SPSS (which is well aware of ties) yields as well:

Coordinates of the Curve
Test Result Variable(s): VAR00008
Positive if Greater Than or Equal Toa Sensitivity 1 - Specificity
.0000 1.000 1.000
1.5000 1.000 .833
2.5000 .889 .833
3.5000 .889 .667
4.5000 .889 .500
5.5000 .778 .500
6.5000 .778 .333
7.5000 .667 .333
8.5000 .667 .167
9.5000 .556 .167
10.5000 .444 .167
12.0000 .333 .167
13.5000 .222 .000
15.0000 .000 .000
The test result variable(s): VAR00008 has at least one tie between the positive actual state group and the negative actual state group.
a The smallest cutoff value is the minimum observed test value minus 1, and the largest cutoff value is the maximum observed test value plus 1. All the other cutoff values are the averages of two consecutive ordered observed test values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.