Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Standar Deviation PHP function
SUBMITTED BY:
Guest
DATE:
Dec. 5, 2013, 3:29 a.m.
FORMAT:
PHP
SIZE:
256 Bytes
Raw
Download
Tweet
HITS:
779
Go to comments
Report
function standard_deviation($sample){
if(is_array($sample)){
$mean = array_sum($sample) / count($sample);
foreach($sample as $key => $num) $devs[$key] = pow($num - $mean, 2);
return sqrt(array_sum($devs) / (count($devs) - 1));
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus