diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index 0bcd1674d..afd73e357 100644 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -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); } /** diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index 09bc6d104..b74d931ec 100644 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -47,7 +47,7 @@ class MeasureOfDispersion $end = end($values); $start = reset($values); - return $start - $end; + return $end - $start; } /**