This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

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's np.std default; torch's std and Julia's std divide by n - 1): sqrt(sum(d * d) / numel(a)) with d = 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.

[1]lines 17–45