Uniform#

class Uniform(left_border, right_border)[source]#

Bases: ContinuousDistribution

The Uniform continuous probability distribution.

The uniform distribution describes an experiment where there is an arbitrary outcome that lies between certain bounds. The probability is constant between these bounds and zero elsewhere.

Parameters:
  • left_border (float) – Left border of section [a, b]. Can be any real number.

  • right_border (float) – Right border of section [a, b]. Can be any real number.

Variables:
  • left_border (float) – Left border of section [a, b].

  • right_border (float) – Right border of section [a, b].

Raises:

ValueError – If left_border is greater than or equal to right_border, or if either parameter is not finite.

Methods

ppf(P)

Percent Point Function (PPF) or quantile function.

pdf(X)

Probability density function (PDF).

lpdf(X)

Log of the Probability Density Function (LPDF).

log_gradients(X)

Calculates the gradients of the log-PDF w.r.t.

generate(size)

Generates random samples from the distribution.