gnome.utilities.distributions

Classes that generate various types of probability distributions

Module Contents

Classes

DistributionBase

Base class for distributions, just to make it easier to know

UniformDistribution

Base class for distributions, just to make it easier to know

NormalDistribution

Base class for distributions, just to make it easier to know

LogNormalDistribution

Base class for distributions, just to make it easier to know

WeibullDistribution

Base class for distributions, just to make it easier to know

RayleighDistribution

Functions

get_distribution_by_name(dist_name)

Return a distribution object corresponding to its name

Attributes

ALL_DISTS

gnome.utilities.distributions.get_distribution_by_name(dist_name)

Return a distribution object corresponding to its name

note: this isn’t really helpful until / unless we standardize the initialization interface.

class gnome.utilities.distributions.DistributionBase(name=None, _appearance=None, *args, **kwargs)

Bases: gnome.gnomeobject.GnomeId

Base class for distributions, just to make it easier to know what is a distribution class

At them moment, all they need is a set_values method

NOTE: if possible, it would be good to have the same interface to all distributions. For example, see: the distributions in numpy.random. for example:

random.normal(loc=0.0, scale=1.0, size=None)

all distribution have a location and a scale, which have different meanings depending on the distribution.

abstract set_values(np_array)
class gnome.utilities.distributions.UniformDistribution(low=0.0, high=0.1, **kwargs)

Bases: DistributionBase

Base class for distributions, just to make it easier to know what is a distribution class

At them moment, all they need is a set_values method

NOTE: if possible, it would be good to have the same interface to all distributions. For example, see: the distributions in numpy.random. for example:

random.normal(loc=0.0, scale=1.0, size=None)

all distribution have a location and a scale, which have different meanings depending on the distribution.

Parameters:
  • low – For the Uniform distribution, it is lower bound.

  • high – For the Uniform distribution, it is upper bound.

_schema

Uniform Probability Distribution

_check_uniform_args()
_uniform(np_array)
set_values(np_array)
class gnome.utilities.distributions.NormalDistribution(mean=0.0, sigma=0.1, **kwargs)

Bases: DistributionBase

Base class for distributions, just to make it easier to know what is a distribution class

At them moment, all they need is a set_values method

NOTE: if possible, it would be good to have the same interface to all distributions. For example, see: the distributions in numpy.random. for example:

random.normal(loc=0.0, scale=1.0, size=None)

all distribution have a location and a scale, which have different meanings depending on the distribution.

Parameters:
  • mean – The mean of the normal distribution

  • sigma – The standard deviation of normal distribution

_schema

Normal Probability Distribution

_check_normal_args()
_normal(np_array)
set_values(np_array)
class gnome.utilities.distributions.LogNormalDistribution(mean=0.0, sigma=0.1, **kwargs)

Bases: DistributionBase

Base class for distributions, just to make it easier to know what is a distribution class

At them moment, all they need is a set_values method

NOTE: if possible, it would be good to have the same interface to all distributions. For example, see: the distributions in numpy.random. for example:

random.normal(loc=0.0, scale=1.0, size=None)

all distribution have a location and a scale, which have different meanings depending on the distribution.

Parameters:
  • mean – The mean of the normal distribution

  • sigma – The standard deviation of normal distribution

_schema

Log Normal Probability Distribution

_check_lognormal_args()
_lognormal(np_array)
set_values(np_array)
class gnome.utilities.distributions.WeibullDistribution(alpha=None, lambda_=1.0, min_=None, max_=None, **kwargs)

Bases: DistributionBase

Base class for distributions, just to make it easier to know what is a distribution class

At them moment, all they need is a set_values method

NOTE: if possible, it would be good to have the same interface to all distributions. For example, see: the distributions in numpy.random. for example:

random.normal(loc=0.0, scale=1.0, size=None)

all distribution have a location and a scale, which have different meanings depending on the distribution.

Parameters:
  • alpha – The shape parameter ‘alpha’ - labeled as ‘a’ in numpy.random.weibull distribution

  • lambda – The scale parameter for the distribution - required for 2-parameter weibull distribution (Rosin-Rammler).

NOTE: underscore names because min, max, and lambda are Python

builtins

_schema

Weibull Probability Distribution, also known as Rosin Rammler distribution

_check_weibull_args()
_weibull(np_array)
set_values(np_array)
class gnome.utilities.distributions.RayleighDistribution
classmethod sigma_from_wind(avg_speed)
classmethod pdf(x, sigma)
classmethod cdf(x, sigma)
classmethod quantile(f, sigma)
gnome.utilities.distributions.ALL_DISTS