mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-13 07:18:39 +00:00
Fix calculation
This commit is contained in:
parent
f9296042ae
commit
7613a42504
|
|
@ -52,11 +52,11 @@ class Average
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @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);
|
$count = count($x);
|
||||||
|
|
||||||
return $x[$count - 1] + $h * ($x[$count - 1] - $x[0]) / ($count - 1);
|
return $h * ($x[$count - 1] - $x[0]) / ($count - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class MeasureOfDispersion
|
||||||
$end = end($values);
|
$end = end($values);
|
||||||
$start = reset($values);
|
$start = reset($values);
|
||||||
|
|
||||||
return $start - $end;
|
return $end - $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user