MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / stddev

Function stddev

source/matplot/util/common.cpp:215–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213 }
214
215 double stddev(const std::vector<double> &x) {
216 double m = mean(x);
217 double sum = 0;
218 for (const double &xi : x) {
219 sum += pow(xi - m, 2);
220 }
221 return sqrt(sum / static_cast<double>(x.size() - 1));
222 }
223
224// windows.h library defines a function-like macro with the name of max()
225#ifdef max

Callers 1

scotts_ruleMethod · 0.85

Calls 2

meanFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected