How to use the variance function from mathjs

Find comprehensive JavaScript mathjs.variance code examples handpicked from public code repositorys.

66
67
68
69
70
71
72
73
74
75

math.mean(numbers);
math.median(numbers);
math.mode(numbers)
math.std(numbers);
math.variance(numbers);
math.sum(numbers);

// probability
math.combinations(7, 5) // number of ways picking 'k' unordered outcomes from 'n' possibilities
fork icon0
star icon3
watch icon0

+ 6 other calls in file

21
22
23
24
25
26
27
28
29
30
	(2+4)/2=3
	(2-3)²=1
	(4-3)²=1
	(1+1)/2=1
*/
console.log('variância:', math.variance([2, 4], 'uncorrected'));
// variância com tendência
/*
	(2+4)/2=3
	(2-3)²=1
fork icon0
star icon0
watch icon0

+ 8 other calls in file