Axect / Peroxide

Rust numeric library with R, MATLAB & Python syntax
https://crates.io/crates/peroxide
Apache License 2.0
509 stars 31 forks source link

Uniform random generator behaviour #23

Closed spar7453 closed 4 years ago

spar7453 commented 4 years ago

I am not sure whether it is intended or not but

Uniform(0,1) has type TPDist and Uniform(0,1).sample(10) type generates random integers between [0, 1), so only zeros

However, Normal(0,1) has the same type TPDist and Nomral(0,1).sample(10) genrates random floats from the distribution

Axect commented 4 years ago

Hello,

Uniform(T, T).sample(n) returns T types vector which has length n. So, if you want to generate float uniform random array then use Uniform(0f64, 1f64) instead. (Documentation is not updated. I'll update documentation asap.)

But for Normal, we don't expect integer or unsigned integer samples. Thus, for Normal only float type samples are allowed.

spar7453 commented 4 years ago

thank you