Notebooks · lib/stats
The mean and the standard deviation of an array
mean(a):sum(a) / numel(a), over every entry whatever the rank.std(a): the population standard deviation, which divides by n (numpy'snp.stddefault; torch'sstdand Julia'sstddivide by n - 1):sqrt(sum(d * d) / numel(a))withd = a - mean(a).
Both add in sum's order, NumPy's pairwise order, which is left to right
below 8 entries, so tools/random_replay.py reproduces the six-sample test
in Python.
Used with import stats.
Look inside this program
- Atlas
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.
Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.