Wikipedia shows symmetric density function, but all values generated by statrs::distribution::Laplace are positibe (assuming zero location parameter).
Formula used in the code reuses uniform float value both as sign and as exponential distribution generator, but actually has no way to ever generate negative values.
Assuming it is this Laplace distribution, generated samples look strangely distributed:
Wikipedia shows symmetric density function, but all values generated by
statrs::distribution::Laplace
are positibe (assuming zerolocation
parameter).Formula used in the code reuses uniform float value both as sign and as exponential distribution generator, but actually has no way to ever generate negative values.