![]() |
![]() |
|
PLS_Toolbox Documentation: unifdf | < triangledf | weibulldf > |
unifdf
Purpose
Uniform distribution.
Synopsis
prob = unifdf(function,x,a,b)
Description
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Uniform distribution.
This distribution is used when all possible outcomes of an experiment are equally likely. The distribution is flat with no peak.
INPUTS:
Note: If inputs (x, a, and b) are not equal in size, the function will attempt to resize all inputs to the largest input using the RESIZE function.
Note: Functions will typically allow input values outside of the acceptable range to be passed but such values will return NaN in the results.
Examples
Cumulative:
>> prob = unifdf('c',1.5,1,2)
prob =
0.5000
>> x = [0:0.1:10];
>> plot(x,unifdf('c',x,1,2),'b-',x,unifdf('c',x,3,7),'r-')
Density:
>> prob = unifdf('d',1.5,1,2)
prob =
1.0000
>> x = [0:0.01:10];
>> plot(x,unifdf('d',x,1,3),'b-',x,unifdf('d',x,1,4),'r-')
>> ylim([0 1])
Quantile:
>> prob = unifdf('q',0.5,1,2)
prob =
1.5
Random:
>> prob = unifdf('r',[4 1],2,1)
ans =
1.9218
1.7382
1.1763
1.4057
See Also
betadf, cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, lognormdf, logisdf, normdf, paretodf, raydf, triangledf, weibulldf
< triangledf | weibulldf > |