:py:mod:`gnome.utilities.distributions` ======================================= .. py:module:: gnome.utilities.distributions .. autoapi-nested-parse:: Classes that generate various types of probability distributions Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.utilities.distributions.DistributionBase gnome.utilities.distributions.UniformDistribution gnome.utilities.distributions.NormalDistribution gnome.utilities.distributions.LogNormalDistribution gnome.utilities.distributions.WeibullDistribution gnome.utilities.distributions.RayleighDistribution Functions ~~~~~~~~~ .. autoapisummary:: gnome.utilities.distributions.get_distribution_by_name Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.utilities.distributions.ALL_DISTS .. py:function:: 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. .. py:class:: DistributionBase(name=None, _appearance=None, *args, **kwargs) Bases: :py:obj:`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. .. py:method:: set_values(np_array) :abstractmethod: .. py:class:: UniformDistribution(low=0.0, high=0.1, **kwargs) Bases: :py:obj:`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. :param low: For the Uniform distribution, it is lower bound. :param high: For the Uniform distribution, it is upper bound. .. py:attribute:: _schema Uniform Probability Distribution .. py:method:: _check_uniform_args() .. py:method:: _uniform(np_array) .. py:method:: set_values(np_array) .. py:class:: NormalDistribution(mean=0.0, sigma=0.1, **kwargs) Bases: :py:obj:`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. :param mean: The mean of the normal distribution :param sigma: The standard deviation of normal distribution .. py:attribute:: _schema Normal Probability Distribution .. py:method:: _check_normal_args() .. py:method:: _normal(np_array) .. py:method:: set_values(np_array) .. py:class:: LogNormalDistribution(mean=0.0, sigma=0.1, **kwargs) Bases: :py:obj:`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. :param mean: The mean of the normal distribution :param sigma: The standard deviation of normal distribution .. py:attribute:: _schema Log Normal Probability Distribution .. py:method:: _check_lognormal_args() .. py:method:: _lognormal(np_array) .. py:method:: set_values(np_array) .. py:class:: WeibullDistribution(alpha=None, lambda_=1.0, min_=None, max_=None, **kwargs) Bases: :py:obj:`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. :param alpha: The shape parameter 'alpha' - labeled as 'a' in numpy.random.weibull distribution :param 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 .. py:attribute:: _schema Weibull Probability Distribution, also known as Rosin Rammler distribution .. py:method:: _check_weibull_args() .. py:method:: _weibull(np_array) .. py:method:: set_values(np_array) .. py:class:: RayleighDistribution .. py:method:: sigma_from_wind(avg_speed) :classmethod: .. py:method:: pdf(x, sigma) :classmethod: .. py:method:: cdf(x, sigma) :classmethod: .. py:method:: quantile(f, sigma) :classmethod: .. py:data:: ALL_DISTS