extension/twilio.js
/**
 * Calculate the standard deviation from a list of numbers.
 * @private
 * @param values The list of numbers to calculate the standard deviation from.
 * @returns The standard deviation of a list of numbers.
 */
Calculate the standard deviation from a list of numbers.
@private
@param values The list of numbers to calculate the standard deviation from.
@returns The standard deviation of a list of numbers.
Calculate the standard deviation from a list of numbers . @private @param values The list of numbers to calculate the standard deviation from . @returns The standard deviation of a list of numbers .
function calculateStandardDeviation(values) {
    if (values.length <= 0) {
        return null;
    }
    var valueAverage = values.reduce(function (partialSum, value) { return partialSum + value; }, 0) / values.length;
    var diffSquared = values.map(function (value) { return Math.pow(value - valueAverage, 2); });
    var stdDev = Math.sqrt(diffSquared.reduce(function (partialSum, value) { return partialSum + value; }, 0) / diffSquared.length);
    return stdDev;
}
function calculateStandardDeviation ( values ) { if ( values . length <= 0 ) { return null ; } var valueAverage = values . reduce ( function ( partialSum , value ) { return partialSum + value ; } , 0 ) / values . length ; var diffSquared = values . map ( function ( value ) { return Math . pow ( value - valueAverage , 2 ) ; } ) ; var stdDev = Math . sqrt ( diffSquared . reduce ( function ( partialSum , value ) { return partialSum + value ; } , 0 ) / diffSquared . length ) ; return stdDev ; }
Calculate the standard deviation from a list of numbers.
Calculate the standard deviation from a list of numbers .