Uniform distribution
Function Uniform(a, b)
Returns a value (sample) with values uniformly distributed between numbers a and b. For example,
Uniform(a, b)
is a continuous distribution in which all numbers between a and b are equally probable.
If you omit a and b, it returns a unit uniform -- that is with numbers distributed evenly between 0 and 1.
If you set optional parameter Integer as true, it returns a discrete uniform distribution over the integers between a and b. For example:
Uniform(1, 100, Integer: True)
is a discrete distribution where each integer 1, 2, ... 99, 100 has an equal probability of 1%.
If you want a discrete uniform distribution over each value of an index I, use ChanceDist:
ChanceDist(1/Size(I), I)
Like most distributions, you may use the Over parameter to generate an array of independent distributions for each combination of indexes. For example:
Uniform(Over: I, J)
returns an independent Uniform(0,1) distribution for each combination of values in indexes I and J.
Library
Distribution
Declaration
Uniform(min: Numeric=0; max: Numeric=1; integer: Boolean=false; over: ... Optional Atomic)
Parameter Estimation
Suppose you have real-valued historic data in X, indexed by I, and you wish to estimate the bounds of the continuous uniform distribution. This is really just a matter of estimating the lower and upper bounds for the data, since the use of this distribution assumes a uniform distribution between those bounds. You can estimate the bounds as:
Xmin := Min(X,I) - 0.5 * (Max(X,I)-Min(X,I)) / Size(I) Xmax := Max(X,I) + 0.5 * (Max(X,I)-Min(X,I)) / Size(I)
If you have discrete integer data in D indexed by I, you can estimate the parameters for the integer uniform distribution Uniform(Xmin, Xmax, Integer: True) as:
Xmin := Floor(Min(D, I) - 0.5 * (Max(D, I)-Min(D, I)) / Size(I) Xmax := Ceil(Max(D, I) + 0.5 * (Max(D, I)-Min(D, I)) / Size(I)
See Also
User Guide
Uniform(min, max)
Creates a uniform distribution between values min and max. If omitted, they default to 0 and 1. If you specify optional parameter Integer: True, it returns a discrete distribution consisting of only the integers between min and max, each with equal probability. See Uniform(min, max, Integer: True) When to use If you know nothing about the uncertain quantity other than its bounds, a uniform distribution between the bounds is appealing. However, situations in which this is truly appropriate are rare. Usually, you know that one end or the middle of the range is more likely than the rest — that is, the quantity has a mode. In such cases, a beta or triangular distribution is a better choice. Library Distribution Example Uniform(5, 10) →
Uniform(min, max, Integer: True)
The Uniform distribution with the optional integer parameter set to True returns discrete distribution over the integers with all integers between and including min and max having equal probability
Uniform(5, 14, Integer: True) →
Enable comment auto-refresher