function _var(array, normalization) {
    var sum = 0;
    var num = 0;

    if (array.length === 0) {
      throw new SyntaxError('Function var requires one or more parameters (0 provided)');
    } // calculate the mean and number of elements


    deepForEach(array, function (value) {
      try {
        sum = add(sum, value);
        num++;
      } catch (err) {
        throw improveErrorMessage(err, 'var', value);
      }
    });
    if (num === 0) throw new Error('Cannot calculate var of an empty array');
    var mean = divide(sum, num); // calculate the variance

    sum = 0;
    deepForEach(array, function (value) {
      var diff = subtract(value, mean);
      sum = add(sum, multiply(diff, diff));
    });

    if (isNaN(sum)) {
      return sum;
    }

    switch (normalization) {
      case 'uncorrected':
        return divide(sum, num);

      case 'biased':
        return divide(sum, num + 1);

      case 'unbiased':
        var zero = type.isBigNumber(sum) ? new type.BigNumber(0) : 0;
        return num === 1 ? zero : divide(sum, num - 1);

      default:
        throw new Error('Unknown normalization "' + normalization + '". ' + 'Choose "unbiased" (default), "uncorrected", or "biased".');
    }
  }
Recursively calculate the variance of an n-dimensional array
@param {Array} array
@param {string} normalization
                       Determines how to normalize the variance:
                       - 'unbiased'    The sum of squared errors is divided by (n - 1)
                       - 'uncorrected' The sum of squared errors is divided by n
                       - 'biased'      The sum of squared errors is divided by (n + 1)
@return {number | BigNumber} variance
@private