DistributionCollection.sample (function)
def sample(self, *args, **kwargs)
Sample from multiple distributions with random seeds automatically determined, but applied to distributions of the same underlying multivariate distribution automatically.
For each unique BaseDistribution.uniqueid in the distributions in dists
a
random seed will be generated and applied to BaseDistribution.sample
for all distributionis in dists
which share that same uniqueid value. By doing
so, any BaseMultivariateDistribution which samples from the same underlying
multivariate distribution (but for a different
BaseMultivariateDistribution.dimension), will be correctly sampled to account
for the covariance/correlation between parameters, but all other 1-D
BaseDistribution objects will be sampled with their own independent
random seeds.
Arguments
*args
: all positional arguments are sent to BaseDistribution.sample for each item indists
.cache_sample
(bool, optional, default=True): whether to cache the sampled values for subsequent calls to DistributionCollection.pdf, DistributionCollection.logpdf, etc.**kwargs
: all keyword arguments are sent to BaseDistribution.sample for each item indists
. Note:seed
is forbidden and will raise a ValueError.
Returns
- (list): list of samples, in same order as DistributionCollection.distributions.
Raises
- ValueError: if
seed
is passed.