replace mean calls

This commit is contained in:
Arkadiusz Kondas 2016-04-27 23:57:05 +02:00
parent 80a712e8a8
commit 52cbda0482
2 changed files with 3 additions and 3 deletions

View File

@ -23,8 +23,8 @@ class Correlation
}
$count = count($x);
$meanX = array_sum($x) / $count;
$meanY = array_sum($y) / $count;
$meanX = Mean::arithmetic($x);
$meanY = Mean::arithmetic($y);
$axb = 0;
$a2 = 0;

View File

@ -28,7 +28,7 @@ class StandardDeviation
throw InvalidArgumentException::arraySizeToSmall(2);
}
$mean = array_sum($a) / $n;
$mean = Mean::arithmetic($a);
$carry = 0.0;
foreach ($a as $val) {
$d = $val - $mean;