-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-1806: Implementation of Doubly Truncated Power Law and Lower Trunc…
…ated Power Law (#1807) * implementation of DoublyTruncatedPowerLaw * implementation of LowerTruncatedPowerLaw * chore: mathematical description in docstrings * chore: mathematical details of `LowerTruncatedPowerLaw` * chore: Fix bug in DoublyTruncatedPowerLaw cdf and icdf calculation * chore: Refactor mean and variance calculation by using kth-moment in DoublyTruncatedPowerLaw * chore: Refactor mean and variance calculation in LowerTruncatedPowerLaw * chore: masking in icdf of LowerTruncatedPowerLaw * chore: entropy of LowerTruncatedPowerLaw * chore: `lax.sqaure` replaced with `jnp.sqaure` * chore: moments and entropy were extra and removed * chore: unit tests * fix: nan gradients fixed, values still diverging * Updated UpperTruncatedPowerLaw with adequate derivations, including fixing the discontinuity point for alpha equals minus one and correct tangents for lower and upper bounds. * Changed constrains of alpha of LowerTruncatedPowerLaw to the smaller minus one and also changed equation to keep equational uniformity UpperTruncatedPowerLaw to and improved stability of the calculation by integrating formula parts inside log to prevent NaN values due to negative values of some parts that could balance out in the end. * chore: code and docstring formated * chore: equation refactor and simplified * chore: equation refactor and simplified * chore: use numpy arrays and numpy constants * chore: high precision computation enable for powerlaws * chore: `__name__` attribute calls removed * chore: powerlaws shifted with truncated distributions * chore: spelling mistakes fixed with code spell checker pre-commit hook * fix typo: perforance->perforamce->performance * chore: explicit enabling/disabling of 64bit floating point numbers * chore: disable everytime and enable x64 for power laws * chore: disable x64 for every test * chore: linked explanation in comments for disabling x64 for future reference for devs * chore: high precision test handeled efficiently for DoublyTruncatedPowerLaw * chore: high precision exception handled in test_log_prob_gradient --------- Co-authored-by: David Ziegler <[email protected]>
- Loading branch information
1 parent
ca8fb39
commit 7d50393
Showing
24 changed files
with
672 additions
and
85 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
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
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
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
Oops, something went wrong.