Ad
  • Custom User Avatar
    Determine the average
    For each datapoint determine the distance from the average.
    Sum all of the distances
    Take an average of the sum
    

    Shouldn't step (3) be Take the average of the distances ?!?

  • Custom User Avatar

    assert.equal(mad(arr), expected, 1e-9);

    I don't think that does what you think it does.

    Did you intend to use assert.approximately?

    This just gives a weird error message on failure.