Wolfram Language
>
Actuarial Computation
>
Random Variables
>
Parametric Statistical Distributions
>
Bounded Domain Distributions
>
UniformDistribution

BUILT-IN WOLFRAM LANGUAGE SYMBOL

# UniformDistribution

UniformDistribution[{min,max}]

represents a continuous uniform statistical distribution giving values between min and max.

UniformDistribution[]

represents a uniform distribution giving values between 0 and 1.

UniformDistribution[{{x_{min},x_{max}},{y_{min},y_{max}},…}]

represents a multivariate uniform distribution over the region .

## DetailsDetails

- UniformDistribution is also known as rectangular distribution.
- The probability density for value x in a uniform distribution is constant for , and is zero for or . »
- UniformDistribution allows min and max to be any real numbers with .
- UniformDistribution can be used with such functions as Mean, CDF, and RandomVariate. »

## BackgroundBackground

- UniformDistribution[{a,b}] represents a statistical distribution (sometimes also known as the rectangular distribution) in which a random variate is equally likely to take any value in the interval . Consequently, the uniform distribution is parametrized entirely by the endpoints of its domain and its probability distribution function is constant on the interval . The standard uniform distribution, which may be returned using UniformDistribution[], is taken on the interval . The uniform distribution also generalizes to multiple variates, each of which is equally likely on some domain.
- The inverse transform method, which allows sampling from an arbitrary distribution by applying the inverse of the cumulative density function of a target random variable to variates selected from a uniform distribution, is an important application of this distribution. Another important property is that when testing a null hypothesis using a p-value with continuous distribution as a test statistic, the p-value has a standard uniform distribution if the null hypothesis is true.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a uniform distribution. Distributed[x,UniformDistribution[{a,b}]], written more concisely as , can be used to assert that a random variable x is distributed according to a uniform distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
- The probability distribution and cumulative density functions may be given using PDF[UniformDistribution[{a,b}],x] and CDF[UniformDistribution[{a,b}],x]. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively.
- DistributionFitTest can be used to test if a given dataset is consistent with a uniform distribution, EstimatedDistribution to estimate a uniform parametric distribution from given data, and FindDistributionParameters to fit data to a uniform distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic uniform distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic uniform distribution.
- TransformedDistribution can be used to represent a transformed uniform distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a uniform distribution and ProductDistribution can be used to compute a joint distribution with independent component distributions involving uniform distributions.
- The uniform distribution is related to a number of other distributions. For example, UniformDistribution[] is a special case of BetaDistribution and PowerDistribution in the sense that (modulo inclusion of the endpoints and ), PDF[UniformDistribution[],x] is equal to both PDF[BetaDistribution[1,1],x] and PDF[PowerDistribution[1,1],x]. The discrete uniform distribution is given by DiscreteUniformDistribiution, and UniformSumDistribution generalizes the uniform distribution to the distribution of a sum of random uniform variates. The sum of two independent and equally distributed uniform distributions yields a symmetric TriangularDistribution. If has a standard uniform distribution, then has a BetaDistribution with parameters and 1. The probability distribution of the -order statistic for an independent and identically distributed sample from a standard uniform distribution (which can be found using OrderDistribution[{UniformDistribution[],n},k]) is given by BetaDistribution[k,1-k+n], with the corresponding expected value of (which may be computed using Expectation[x,xBetaDistribution[k,1-k+n]]) given by . Other closely related distributions include VonMisesDistribution, LogisticDistribution, WeibullDistribution, LaplaceDistribution, BatesDistribution, and ChiSquareDistribution.

## ExamplesExamplesopen allclose all

### Basic Examples (8)Basic Examples (8)

Probability density function of univariate uniform distribution:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Cumulative distribution function of univariate uniform distribution:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Mean and variance of univariate uniform distribution:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Median of univariate uniform distribution:

In[1]:= |

Out[1]= |

Probability density function in two dimensions:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Cumulative distribution function in two dimensions:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Mean and variance in two dimensions:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[1]:= |

Out[1]//MatrixForm= | |

Introduced in 2007

(6.0)

| Updated in 2010 (8.0)

© 2014 Wolfram. All rights reserved.