Skip to content

Commit

Permalink
phpdoc update for correlation and covariance
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-butti committed Feb 21, 2022
1 parent c71e2b5 commit 7e8c60b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ public static function harmonicMean(array $data, ?array $weights = null, ?int $r
* Covariance is a measure of the joint variability of two inputs.
* @param array<int|float> $x
* @param array<int|float> $y
* @throws InvalidDataInputException if 2 arrays have different size,
* or if the length of arrays are < 2, or if the 2 input arrays has not numeric elements
* @return false|float
*/
public static function covariance(array $x, array $y): false|float
Expand Down Expand Up @@ -396,6 +398,9 @@ public static function covariance(array $x, array $y): false|float
* and 0 no linear relationship.
* @param array<int|float> $x
* @param array<int|float> $y
* @throws InvalidDataInputException if 2 arrays have different size,
* or if the length of arrays are < 2, or if the 2 input arrays has not numeric elements,
* or if the elements of the array are constants
* @return false|float
*/
public static function correlation(array $x, array $y): false|float
Expand Down
2 changes: 1 addition & 1 deletion tests/StatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,5 @@
[2, 2, 2]
)
)->toThrow(InvalidDataInputException::class);

});

0 comments on commit 7e8c60b

Please sign in to comment.