Uniform Distribution

DESCRIPTION:

Density, cumulative probability, quantiles and random generation for the uniform distribution.

USAGE:

dunif(x, min=0, max=1, log=F) 
punif(q, min=0, max=1) 
qunif(p, min=0, max=1) 
runif(n, min=0, max=1, bigdata=F) 

REQUIRED ARGUMENTS:

x
vector or bdVector of quantiles. Missing values ( NAs) are allowed.
q
vector or bdVector of quantiles. Missing values ( NAs) are allowed.
p
vector or bdVector of probabilities. Missing values ( NAs) are allowed.
n
non-negative sample size. If length(n) is larger than 1, then length(n) random values are returned.

OPTIONAL ARGUMENTS:

min
vector or bdVector of lower limits. This is replicated to be the same length as p or q or the number of deviates generated.
max
vector or bdVector of upper limits (greater than lower limits). This is replicated to be the same length as p or q or the number of deviates generated.
bigdata
a logical value; if TRUE, an object of type bdVector is returned. Otherwise, a vector object is returned. This argument can be used only if the bigdata library section has been loaded.
log
a logical scalar; if TRUE, dunif will return the log of the density, not the density itself.

VALUE:

density ( dunif), probability ( punif), quantile ( qunif), or random sample ( runif) for the uniform distribution on the range min to max.

SIDE EFFECTS:

The function runif causes creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:

Elements of q or p that are missing will cause the corresponding elements of the result to be missing. Missing values are allowed in min and max but result in NAs in the result and create a warning message.

BACKGROUND:

The uniform (or rectangular) distribution takes values equally likely from min to max. The uniform commonly models round-off error among other uses.

For information on the underlying algorithm the uniform random number generator, uses, see the set.seed help file.

REFERENCES:

Johnson, N. L. and Kotz, S. (1970). Continuous Univariate Distributions, vol. 2. Houghton-Mifflin, Boston.

SEE ALSO:

, use to generate a uniform sample on integers or populations.

EXAMPLES:

x + runif(x)   # jitter the x data 
runif(100, -1, 1) # 100 numbers uniform on --1 to 1