[SciPy-User] Use numpy.random.RandomState with scipy.stats

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] Use numpy.random.RandomState with scipy.stats

Ahmed Fasih
I really like the random variable objects in scipy.stats, e.g., scipy.stats.norm, which let me store the parameters of a distribution and sample from it. I see that, to get repeatable results, scipy.stats documentation suggests setting the default global Numpy random seed via numpy.random.seed. The rest of my application uses individual random streams generated from numpy.random.RandomState, since I may have multiple streams. Is there any way to get my scipy.stats random variable objects to use a user-supplied RandomState object instead of the default numpy stream? If not, would this qualify as a (minor) bug?
Thanks,
Ahmed

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Use numpy.random.RandomState with scipy.stats

Robert Kern-2
On Tue, May 7, 2013 at 2:57 PM, Ahmed Fasih <[hidden email]> wrote:
> I really like the random variable objects in scipy.stats, e.g.,
> scipy.stats.norm, which let me store the parameters of a distribution and
> sample from it. I see that, to get repeatable results, scipy.stats
> documentation suggests setting the default global Numpy random seed via
> numpy.random.seed. The rest of my application uses individual random streams
> generated from numpy.random.RandomState, since I may have multiple streams.
> Is there any way to get my scipy.stats random variable objects to use a
> user-supplied RandomState object instead of the default numpy stream? If
> not, would this qualify as a (minor) bug?

Not quite a bug. It is a long-sought missing feature.

--
Robert Kern
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user