These functions provide the ability for generating probability density values, cumulative probability density values and moments about zero values for the Uniform Distribution bounded between [0,1].
mazUNI(r)
Arguments
r: vector of moments
Returns
The output of mazUNI gives the moments about zero in vector form.
Details
Setting a=0 and b=1 in the Uniform Distribution a unit bounded Uniform Distribution can be obtained. The probability density function and cumulative density function of a unit bounded Uniform Distribution with random variable P are given by
gP(p)=1
0≤p≤1
GP(p)=p
0≤p≤1
The mean and the variance are denoted as
E[P]=a+b1=0.5var[P]=12(b−a)2=0.0833
Moments about zero is denoted as
E[Pr]=r(b−a)erb−era=rer−1
r=1,2,3,...
NOTE : If input parameters are not in given domain conditions necessary error messages will be provided to go further.
Examples
#plotting the random variables and probability valuesplot(seq(0,1,by=0.01),dUNI(seq(0,1,by=0.01))$pdf,type ="l",main="Probability density graph",xlab="Random variable",ylab="Probability density values")dUNI(seq(0,1,by=0.05))$pdf #extract the pdf valuesdUNI(seq(0,1,by=0.01))$mean #extract the meandUNI(seq(0,1,by=0.01))$var #extract the variance#plotting the random variables and cumulative probability valuesplot(seq(0,1,by=0.01),pUNI(seq(0,1,by=0.01)),type ="l",main="Cumulative density graph",xlab="Random variable",ylab="Cumulative density values")pUNI(seq(0,1,by=0.05))#acquiring the cumulative probability valuesmazUNI(c(1,2,3))#acquiring the moment about zero values#only the integer value of moments is taken here because moments cannot be decimalmazUNI(1.9)