mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-13 15:18:41 +00:00
fix statistics function during documentation update
This commit is contained in:
parent
7c8469c114
commit
2612e1f862
|
|
@ -172,6 +172,8 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
|
* @latex \mu = mean = \frac{1}{n}\sum_{i=1}^{n}a_i
|
||||||
|
*
|
||||||
* @param array<int, int|float> $values Values
|
* @param array<int, int|float> $values Values
|
||||||
* @param int $offset Offset for outlier
|
* @param int $offset Offset for outlier
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ final class Correlation
|
||||||
*
|
*
|
||||||
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
||||||
*
|
*
|
||||||
|
* @latex \rho_{XY} = \frac{cov(X, Y)}{\sigma_X \sigma_Y}
|
||||||
|
*
|
||||||
* @param array<int|float> $x Values
|
* @param array<int|float> $x Values
|
||||||
* @param array<int|float> $y Values
|
* @param array<int|float> $y Values
|
||||||
*
|
*
|
||||||
|
|
@ -56,6 +58,8 @@ final class Correlation
|
||||||
*
|
*
|
||||||
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
||||||
*
|
*
|
||||||
|
* @latex \rho_{XY} = \frac{cov(X, Y)}{\sigma_X \sigma_Y}
|
||||||
|
*
|
||||||
* @param array<int|float> $x Values
|
* @param array<int|float> $x Values
|
||||||
* @param array<int|float> $y Values
|
* @param array<int|float> $y Values
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
||||||
*
|
*
|
||||||
* @latex \sigma_{XY} = cov(X, Y) = \sum_{i = 1}^{N}\frac{\left(x_{i} - \bar{X}\right) \left(y_{i} - \bar{Y}\right)}{N - 1}
|
* @latex cov(X,Y) = \frac{1}{N} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)\left(y_{i} - \bar{Y}\right)
|
||||||
*
|
*
|
||||||
* @param array<int, int|float> $x Values
|
* @param array<int, int|float> $x Values
|
||||||
* @param array<int, int|float> $y Values
|
* @param array<int, int|float> $y Values
|
||||||
|
|
@ -255,7 +255,7 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
* Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3])
|
||||||
*
|
*
|
||||||
* @latex \sigma_{XY} = cov(X, Y) = \sum_{i = 1}^{N}\frac{\left(x_{i} - \bar{X}\right) \left(y_{i} - \bar{Y}\right)}{N - 1}
|
* @latex cov(X,Y) = \frac{1}{N - 1} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)\left(y_{i} - \bar{Y}\right)
|
||||||
*
|
*
|
||||||
* @param array<int, int|float> $x Values
|
* @param array<int, int|float> $x Values
|
||||||
* @param array<int, int|float> $y Values
|
* @param array<int, int|float> $y Values
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,8 @@ final class ChiSquaredDistribution
|
||||||
/**
|
/**
|
||||||
* Test hypthesis.
|
* Test hypthesis.
|
||||||
*
|
*
|
||||||
|
* Goodness of fit test.
|
||||||
|
*
|
||||||
* @param array $dataset Values
|
* @param array $dataset Values
|
||||||
* @param array $expected Expected values based on probability
|
* @param array $expected Expected values based on probability
|
||||||
* @param float $significance Significance
|
* @param float $significance Significance
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,20 @@ final class ArrayUtils
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the range of the array
|
||||||
|
*
|
||||||
|
* @param int[]|float[] $values Numeric values
|
||||||
|
*
|
||||||
|
* @return int|float Range of the array
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function range(array $values) : int|float
|
||||||
|
{
|
||||||
|
return \max($values) - \min($values);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set element in array by path
|
* Set element in array by path
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user