Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection of tests to be subjected to Zscore (and other stats that use sample size) in Benford object #41

Closed
milcent opened this issue Sep 24, 2020 · 2 comments

Comments

@milcent
Copy link
Owner

milcent commented Sep 24, 2020

Currently, the Benford object, after internalizing the data, perfoms all first order tests (F1D, F2D, F3D, SD and L2D) by default.
Then one can use other methos so it also includes the Summation (F1D_Sum, F2D_Sum and F3D_Sum), the Mantissas and the Second Order (F1D_Sec, F2D_Sec...) tests.
However, when the data do not span across multiple orders of magnitude, some digits combinations may have no hits, especially the First-Two-Digits (45, 77...) and First-Three-Digits (122, 670,...), which will cause a DivisionbyZero error when computing the Z scores, since it uses the number of hits as denominator, as well noticed by @ditlevjoergensen in #40.
Ideally, then, when initializing, there should be some safeguard preventing the Z scores of even being called on that Test object if there are no hits, and the user is informed of that if the verbose flag is on.

@milcent
Copy link
Owner Author

milcent commented Nov 20, 2020

Inserted a fix in set_N function, so it won't return 0

@milcent milcent closed this as completed Nov 20, 2020
@ditlevjoergensen
Copy link

Fantastic job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants