MCPcopy
hub / github.com/angular/angular / calculateStandardDeviation

Method calculateStandardDeviation

packages/benchpress/src/statistic.ts:20–26  ·  view source on GitHub ↗
(samples: number[], mean: number)

Source from the content-addressed store, hash-verified

18 }
19
20 static calculateStandardDeviation(samples: number[], mean: number) {
21 let deviation = 0;
22 samples.forEach((x) => (deviation += Math.pow(x - mean, 2)));
23 deviation = deviation / samples.length;
24 deviation = Math.sqrt(deviation);
25 return deviation;
26 }
27
28 static calculateRegressionSlope(
29 xValues: number[],

Callers 2

statistic_spec.tsFile · 0.80

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected