php calculate variance

35

$variance = array_sum(array_map(function ($x) use ($fMean) { 
    return pow($x - $fMean, 2);
}, $array)) / count($array);

Comments

Submit
0 Comments