-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 78: Solve Division by Zero when performing a chi squared good f…
…itness test. (#79) * test: Write tests for the ZeroDivisionError ocurred on chi squared. * fix: Implement zero division bugfix in lower gamma function calculation. This change implements a fix, discovered in #78 , where the incomplete gamma function raises a `ZeroDivisionError` when X is too small. This was caused by the liberal use of the `round` function when calculating the iterations needed to perform the simpson's rule. Now, with this change, if the X is too small, it rounds it to the first decimal, then rounds it again after multiplying it by 10_000. Now, if the second round still give us zero, then we default to 100_000 iterations instead, as we must assume it's a pretty small value that needs to be accounted for. * fix: Update p-value in certain tests due to the increased iterations.
- Loading branch information
1 parent
4d0372b
commit 5ae8a05
Showing
4 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters