The probability density function for the uniform distribution.
Given two values a and b with a < b, the uniform distribution on
[a,b] has density function 1/(b−a) for x in [a,b]. The
uniform
(or uniformd) command
computes this density function.
-
uniform (or uniformd) takes three arguments:
-
a and b, real numbers with a<b.
- x, a real number.
- uniform(a,b,x) (or uniformd(a,b,x))
returns the value of the probability density function for the
uniform distribution from a to b, namely 1/(b−a).
Example
The cumulative distribution function for the uniform distribution.
The uniform_cdf
or uniformd_cdf
command finds the cumulative distribution
function for the uniform distribution.
-
uniform_cdf takes three mandatory arguments and one
optional argument:
-
a and b, real numbers with a<b.
- x, a real number.
- Optionally y, a real number.
- uniform_cdf(a,b,x) returns the value of the
cumulative distribution function for the uniform distribution from
a to b, which in this case will be (x−a)/(b−a).
- uniform_cdf(a,b,x,y) returns
Prob(x ≤ X ≤ y), which in this case will be
(y−x)/(b−a).
Examples
The inverse distribution function for the uniform distribution.
The uniform_icdf
or uniformd_icdf
command computes the inverse distribution
for the uniform distribution.
-
uniform_icdf takes three arguments:
-
a and b, real numbers with a<b.
- h, a real number between 0 and 1.
- uniform_icdf(a,b,h) returns the value of the
inverse distribution function to the uniform distribution from a
to b; namely the value of x for which h=Prob(X ≤ x).
Example