-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid calling
log(0)
when generating gaussian random variables (#662)
* owl_stats_ziggurat: avoid log(0) sfmt_f64_1 is documented to include 0, which would result in `log(0) = neg_infinity`. use sfmt_f64_3 instead which is documented to return `(0, 1)` instead. This should also match the paper, which says "UNI floats it to (0,1)": > Marsaglia, George, and Wai Wan Tsang. > "The ziggurat method for generating random variables." > Journal of statistical software 5 (2000): 1-7. See #661 Signed-off-by: Edwin Török <edwin@etorok.net> * Owl_base_stats_dist_uniform: add a function that returns a random float in (0,1) Signed-off-by: Edwin Török <edwin@etorok.net> * Owl_base_stats_dist_gaussian.{std_gaussian_rvs,gaussian_rvs}: avoid infinity on Random.float returning 0 #661 Signed-off-by: Edwin Török <edwin@etorok.net> --------- Signed-off-by: Edwin Török <edwin@etorok.net>
- Loading branch information
1 parent
c66069e
commit 621cbff
Showing
3 changed files
with
15 additions
and
10 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