Distribution

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

Bases: Protocol

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.

Attributes Documentation

loc

Returns the location of the distributon (usually mean)

Return type

float

max

Returns the maximum

Return type

float

min

Returns the minimum

Return type

float

scale

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

Return type

float

Methods Documentation

__call__(val)[source]

Returns the probability for the given value

Return type

float

abstract cum_prob(mn, mx)[source]

Returns the probability for the given range

Return type

float

is_crisp()[source]

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

Return type

bool

abstract is_gaussian()[source]

Returns true if this is a gaussian distribution

Return type

bool

abstract is_uniform()[source]

Returns true if this is a uniform distribution

Return type

bool

abstract mean()[source]

Finds the mean

Return type

float

abstract prob(val)[source]

Returns the probability for the given value

Return type

float

abstract sample(size=1)[source]

Samples size elements from the distribution

Return type

ndarray

abstract type()[source]

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

Return type

str