I am trying to generate scipy.stats.pareto.rvs(b, loc=0, scale=1, size=1) with different seed.
In numpy we can seed using numpy.random.seed(seed=233423).
Is ther
For those who happen upon this post four years later, Scipy DOES provide a way to pass a np.random.RandomState
object to its random variable classes, see rv_continuous and rv_discrete for more details. The scipy documentation says this:
seed : None or int or numpy.random.RandomState instance, optional
This parameter defines the RandomState object to use for drawing random variates. If None (or np.random), the global np.random state is used. If integer, it is used to seed the local RandomState instance. Default is None.
Unfortunately, it appears this argument is not available after the continuous/discrete rvs subclass rv_continuous
or rv_discrete
. However, the random_state
property does belong to the sublass, meaning we can set the seed using an instance of np.random.RandomState
after instantiation like so:
import numpy as np
import scipy.stats as stats
alpha_rv = stats.alpha(3.57)
alpha_rv.random_state = np.random.RandomState(seed=342423)