function mean(vector) {
  let sum = 0;
  for (const x of vector) {
    sum += x;
  }
  return sum / vector.length;
}
Calculate the arithmetic mean of a vector.

@param {Array} vector The vector represented as an Array of Numbers.

@returns {number} The arithmetic mean.