ScipyDistribution
- class negmas.helpers.ScipyDistribution(type, **kwargs)[source]
Bases:
negmas.helpers.prob.Distribution
Any distribution from scipy.stats with overloading of addition and multiplication.
- Parameters
type (str) – Data type of the distribution as a string. It must be one defined in
scipy.stats
loc (float) – The location of the distribution (corresponds to mean in Gaussian)
scale (float) – The _scale of the distribution (corresponds to standard deviation in Gaussian)
**kwargs –
Examples
>>> d2 = ScipyDistribution('uniform') >>> print(d2.mean()) 0.5
>>> try: ... d = ScipyDistribution('something crazy') ... except ValueError as e: ... print(str(e)) Unknown distribution something crazy
Attributes Summary
Returns the location of the distributon (usually mean)
Returns the maximum
Returns the minimum
Returns the scale of the distribution (may be std.
Methods Summary
__call__
(val)Returns the probability for the given value
cum_prob
(mn, mx)Returns the probability for the given range
is_crisp
()Returns true if this is a distribution with all probability at one point (delta(v))
Returns true if this is a gaussian distribution
Returns true if this is a uniform distribution
mean
()Finds the mean
prob
(val)Returns the probability for the given value
sample
([size])Samples
size
elements from the distributiontype
()Returns the distribution type (e.g.
Attributes Documentation
- loc
- max
- min
- scale
Methods Documentation
- is_crisp()
Returns true if this is a distribution with all probability at one point (delta(v))
- Return type