nlib icon indicating copy to clipboard operation
nlib copied to clipboard

Exponential sampling is wrong

Open Oleg-Krivosheev opened this issue 8 years ago • 0 comments

Formula (6.67, 6.68). Statement that -log(1-u) is equivalent to -log(u) is true iff u is U(0,1) in the (0,1) range. In reality Python U(0,1) as well as C/C++ U(0,1) are defined in the interval [0,1). Thus, -log(1-u) will always work while -log(u) sometimes will produce FP exceptions when 0 is sampled

Oleg-Krivosheev avatar May 31 '17 20:05 Oleg-Krivosheev