Fix calculation

This commit is contained in:
Dennis Eichhorn 2017-10-23 17:30:52 +02:00
parent f9296042ae
commit 7613a42504
2 changed files with 3 additions and 3 deletions

View File

@ -52,11 +52,11 @@ class Average
*
* @since 1.0.0
*/
public static function averageChange(array $x, int $h = 1) : float
public static function averageDatasetChange(array $x, int $h = 1) : float
{
$count = count($x);
return $x[$count - 1] + $h * ($x[$count - 1] - $x[0]) / ($count - 1);
return $h * ($x[$count - 1] - $x[0]) / ($count - 1);
}
/**

View File

@ -47,7 +47,7 @@ class MeasureOfDispersion
$end = end($values);
$start = reset($values);
return $start - $end;
return $end - $start;
}
/**