MCPcopy Create free account
hub / github.com/arq5x/bedtools2 / getStddev

Method getStddev

src/utils/KeyListOps/KeyListOpsMethods.cpp:59–70  ·  view source on GitHub ↗

return the standard deviation

Source from the content-addressed store, hash-verified

57
58 // return the standard deviation
59double KeyListOpsMethods::getStddev() {
60 if (empty()) return NAN;
61
62 double avg = getMean();
63 double squareDiffSum = 0.0;
64 for (begin(); !end(); next()) {
65 double val = getColValNum();
66 double diff = val - avg;
67 squareDiffSum += diff * diff;
68 }
69 return sqrt(squareDiffSum / (float)getCount());
70}
71// return the standard deviation
72double KeyListOpsMethods::getSampleStddev() {
73 if (empty()) return NAN;

Callers 1

KeyListOps.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected