MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / stats

Function stats

tools/load-test.js:89–94  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

87 * and returns {mean: 2, stddev: 0.816}
88 */
89function stats(values) {
90 if (values.length == 0) return {mean: NaN, stddev: NaN};
91 const mean = sum(values) / values.length;
92 const stddev = Math.sqrt(sum(values.map(x => (x-mean)**2)) / values.length);
93 return {mean, stddev};
94}
95
96/* Takes:
97 * {

Callers 1

objectStatsFunction · 0.85

Calls 1

sumFunction · 0.85

Tested by

no test coverage detected