probabilistic_model.distributions.uniform
=========================================

.. py:module:: probabilistic_model.distributions.uniform


Classes
-------

.. autoapisummary::

   probabilistic_model.distributions.uniform.UniformDistribution


Module Contents
---------------

.. py:class:: UniformDistribution(variable: probabilistic_model.distributions.distributions.Continuous, interval: probabilistic_model.distributions.distributions.SimpleInterval)

   Bases: :py:obj:`probabilistic_model.distributions.distributions.ContinuousDistributionWithFiniteSupport`


   Class for uniform distributions over the half-open interval [lower, upper).


   .. py:attribute:: variable


   .. py:attribute:: interval

      The interval of the distribution.



   .. py:method:: log_likelihood_without_bounds_check(x: probabilistic_model.distributions.distributions.np.array) -> probabilistic_model.distributions.distributions.np.array

      Evaluate the logarithmic likelihood function at `x` without checking the inclusion into the interval.
      :param x: x where p(x) > 0
      :return: log(p(x))



   .. py:method:: cdf(x: probabilistic_model.distributions.distributions.np.array) -> probabilistic_model.distributions.distributions.np.array

      Calculate the cumulative distribution function at x.
      :param x: The data
      :return: The cumulative distribution function at x



   .. py:method:: univariate_log_mode() -> probabilistic_model.distributions.distributions.Tuple[probabilistic_model.distributions.distributions.AbstractCompositeSet, float]

      :return: The univariate mode of the distribution and its log-likelihood. The mode is not an Event.



   .. py:method:: log_conditional_from_simple_interval(interval: probabilistic_model.distributions.distributions.SimpleInterval) -> probabilistic_model.distributions.distributions.Tuple[probabilistic_model.distributions.distributions.Self, float]

      Calculate the truncated distribution given a simple interval.

      :param interval: The simple interval
      :return: The truncated distribution and the log-probability of the interval.



   .. py:method:: sample(amount: int) -> probabilistic_model.distributions.distributions.np.array

      Sample from the model.

      :param amount: The number of samples to draw.
      :return: The samples.



   .. py:method:: pdf_value() -> float

      Calculate the density of the uniform distribution.



   .. py:method:: log_pdf_value() -> float

      Calculate the log-density of the uniform distribution.



   .. py:method:: moment(order: probabilistic_model.distributions.distributions.OrderType, center: probabilistic_model.distributions.distributions.CenterType) -> probabilistic_model.distributions.distributions.MomentType

      Calculate the (centralized) moment of the distribution.

      .. math::

          \int_{-\infty}^{\infty} (x - center)^{order} pdf(x) dx

      .. Note:: You can read more about queries of this class in Definition 22 in :cite:p:`choi2020probabilistic`_.
          :cite:p:`youtube2020probabilistic`


      :param order: The orders of the moment as a variable map for every continuous and integer variable.
      :param center: The center of the moment as a variable map for every continuous and integer variable.
      :return: The moments of the variables in `order`.



   .. py:method:: __eq__(other)


   .. py:property:: drawio_label

      The label of the object as a drawio compatible string.



   .. py:property:: representation

      The symbol used to represent this distribution.



   .. py:property:: abbreviated_symbol
      :type: str



   .. py:method:: __repr__()


   .. py:property:: image


   .. py:method:: __copy__()


   .. py:method:: __deepcopy__(memo=None)


   .. py:method:: to_json() -> probabilistic_model.distributions.distributions.Dict[str, probabilistic_model.distributions.distributions.Any]


   .. py:method:: _from_json(data: probabilistic_model.distributions.distributions.Dict[str, probabilistic_model.distributions.distributions.Any]) -> probabilistic_model.distributions.distributions.Self
      :classmethod:


      Create a variable from a json dict.
      This method is called from the from_json method after the correct subclass is determined and should be
      overwritten by the respective subclass.

      :param data: The json dict
      :return: The deserialized object



   .. py:method:: x_axis_points_for_plotly() -> probabilistic_model.distributions.distributions.List[probabilistic_model.distributions.distributions.Union[None, float]]


   .. py:method:: pdf_trace() -> probabilistic_model.distributions.distributions.go.Scatter


   .. py:method:: cdf_trace() -> probabilistic_model.distributions.distributions.go.Scatter


   .. py:method:: plot(**kwargs) -> probabilistic_model.distributions.distributions.List

      Generate traces that can be plotted with plotly.

      :param number_of_samples: The number of samples to draw.
      :param surface: If True, plot the model as a surface plot.
      :param mode: If True, plot the mode of the model.
      :return: The traces.



   .. py:method:: __hash__()


