Unless I've gone completely insane, the documentation for numpy.random.exponential()
suggests that setting the scale parameter to 1.0 should guarantee that function calls return a number between 0.0 and 1.0, since it is only defined for x > 0.
I've graphed it on wolfram alpha to verify I'm not going insane and it does range from 0 to 1.
I also tried both numpy.random.exponential() since the default argument is 1.0 and numpy.random.standard_exponential(), but both sometimes give me values greater than 1.
I feel like I've made some silly mistake in my understanding but cannot find it. Any help would be greatly appreciated.
Example code that I ran:
import numpy as np
print np.random.exponential(scale=1.0)
Example returned value:
1.56783951494
Aucun commentaire:
Enregistrer un commentaire