Distribution

class negmas.preferences.Distribution(*args, **kwargs)[source]

Bases: Protocol

A protocol representing a probability distribution

Attributes Summary

loc

Returns the location of the distributon (usually mean)

max

Returns the maximum

min

Returns the minimum

scale

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))

is_gaussian()

Returns true if this is a gaussian distribution

is_uniform()

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 distribution

type()

Returns the distribution type (e.g. uniform, normal, ...).

Attributes Documentation

loc

Returns the location of the distributon (usually mean)

max

Returns the maximum

min

Returns the minimum

scale

Returns the scale of the distribution (may be std. dev.)

Methods Documentation

__call__(val: float) float[source]

Returns the probability for the given value

cum_prob(mn: float, mx: float) float[source]

Returns the probability for the given range

is_crisp() bool[source]

Returns true if this is a distribution with all probability at one point (delta(v))

is_gaussian() bool[source]

Returns true if this is a gaussian distribution

is_uniform() bool[source]

Returns true if this is a uniform distribution

mean() float[source]

Finds the mean

prob(val: float) float[source]

Returns the probability for the given value

sample(size: int = 1) Iterable[float][source]

Samples size elements from the distribution

type() str[source]

Returns the distribution type (e.g. uniform, normal, …)