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

Method getSampleStddev

src/utils/KeyListOps/KeyListOpsMethods.cpp:72–83  ·  view source on GitHub ↗

return the standard deviation

Source from the content-addressed store, hash-verified

70}
71// return the standard deviation
72double KeyListOpsMethods::getSampleStddev() {
73 if (empty()) return NAN;
74
75 double avg = getMean();
76 double squareDiffSum = 0.0;
77 for (begin(); !end(); next()) {
78 double val = getColValNum();
79 double diff = val - avg;
80 squareDiffSum += diff * diff;
81 }
82 return sqrt(squareDiffSum / ((float)getCount() - 1.0));
83}
84
85// return the median value in the vector
86double KeyListOpsMethods::getMedian() {

Callers 1

KeyListOps.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected