Documente Academic
Documente Profesional
Documente Cultură
Overview
The uniform distribution (also called the rectangular distribution) is notable because it has a constant
probability distribution function (pdf) between its two bounding parameters. It is appropriate for
representing the distribution of round-off errors in values tabulated to a particular number of decimal
places, and is used in random number generating techniques such as the inversion method.
Parameters
The uniform distribution uses the following parameters.
Parameter
Description
Constraints
lower
Lower limit
<lower<upper
upper
Upper limit
lower<upper<
Parameter Estimation
The maximum likelihood estimator (MLE) for lower is the sample minimum. The MLE for upper is the
sample maximum.
f(xlower,upper)=(
otherwise.
1upperlower
);lowerxupper0;
As the distance between lower and upper increases, the density at any particular value within the
distribution boundaries decreases. Because the density function integrates to 1, the height of the pdf plot
decreases as its width increases.
(
)
F xlower,upper =0;
x
;lower1;x<lowerx<upperupper.
xlowerupperlower
This plot illustrates how changing the value of the parameters lower and upper affects the shape of the
cdf.
% Create three distribution objects with different parameters
pd1 = makedist('Uniform');
pd2 = makedist('Uniform','lower',-2,'upper',2);
pd3 = makedist('Uniform','lower',-2,'upper',1);
% Compute the cdfs
x = -3:.01:3;
cdf1 = cdf(pd1,x);
cdf2 = cdf(pd2,x);
cdf3 = cdf(pd3,x);
% Plot the cdfs
figure;
plot(x,cdf1,'r','LineWidth',2);
hold on;
plot(x,cdf2,'k:','LineWidth',2);
plot(x,cdf3,'b-.','LineWidth',2);
ylim([0 1.1]);
legend({'lower = 0, upper = 1','lower = -2, upper = 2',...
'lower = -2, upper = 1'},'Location','NW');
hold off;
Descriptive Statistics
The mean and variance of the continuous uniform distribution are related to the
parameters lower and upper.
The mean is
mean=
(
12
)
lower+upper .
The variance is
(
)2
var=
upperlower .
112
This example shows how to generate random numbers using the uniform distribution inversion method.
This is useful for distributions when it is possible to compute the inverse cumulative distribution function,
but there is no support for sampling from the distribution directly.
The histogram shows that the random numbers generated using the Weibull inverse cdf
function wblinv have a Weibull distribution.
The histogram shows that, by using the standard normal inverse cdf norminv, the random numbers
generated from u now have a standard normal distribution.