The distribution of the mean of uniform random variables with each of them
in the interval (-1, 1)
, then scaled and shifted.
rvmeanunif(n = 1, mode = 0, scale = 1, df)
Length of the vector to output
Mode (center) of the distribution
Scale (half-width) of the distribution around the mode
"degrees of freedom": number of independent components to average
A random vector of length n
.
Assuming that all inputs are constants, each generated variable has a mode
(center) at mode
, constrained between (-scale, scale)
.
The shape becomes more and more bell-shaped (Normal) as the number of the independent variables in the sum (mean) increases.
The case of df=2
(mean of two variables) is the special case of the
symmetric triangular distribution in the range
x <- rvtriang(1)
y <- rvmeanunif(df=2) ## same distribution as that of x