function stddev(vector) {
  let squareSum = 0;
  const vectorMean = mean(vector);
  for (const x of vector) {
    squareSum += (x - vectorMean) * (x - vectorMean);
  }
  return Math.sqrt(squareSum / (vector.length - 1));
}
Calculate the standard deviation of a vector.

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

@returns {number} The standard deviation.