mazGAMMA function

Gamma Distribution

Gamma Distribution

These functions provide the ability for generating probability density values, cumulative probability density values and moment about zero values for Gamma Distribution bounded between [0,1].

mazGAMMA(r,c,l)

Arguments

  • r: vector of moments.
  • c: single value for shape parameter c.
  • l: single value for shape parameter l.

Returns

The output of mazGAMMA gives the moments about zero in vector form.

Details

The probability density function and cumulative density function of a unit bounded Gamma distribution with random variable P are given by

gP(p)=clpc1γ(l)[ln(1/p)]l1 g_{P}(p) = \frac{ c^l p^{c-1}}{\gamma(l)} [ln(1/p)]^{l-1}

; 0p10 \le p \le 1

GP(p)=Ig(l,cln(1/p))γ(l) G_{P}(p) = \frac{ Ig(l,cln(1/p))}{\gamma(l)}

; 0p10 \le p \le 1

l,c>0 l,c > 0

The mean the variance are denoted by

E[P]=(cc+1)l E[P] = (\frac{c}{c+1})^l var[P]=(cc+2)l(cc+1)2l var[P] = (\frac{c}{c+2})^l - (\frac{c}{c+1})^{2l}

The moments about zero is denoted as

E[Pr]=(cc+r)l E[P^r]=(\frac{c}{c+r})^l

r=1,2,3,...r = 1,2,3,...

Defined as γ(l)\gamma(l) is the gamma function. Defined as Ig(l,cln(1/p))=0cln(1/p)tl1etdtIg(l,cln(1/p))= \int_0^{cln(1/p)} t^{l-1} e^{-t}dt is the Lower incomplete gamma function.

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 values col <- rainbow(4) a <- c(1,2,5,10) plot(0,0,main="Probability density graph",xlab="Random variable",ylab="Probability density values", xlim = c(0,1),ylim = c(0,4)) for (i in 1:4) { lines(seq(0,1,by=0.01),dGAMMA(seq(0,1,by=0.01),a[i],a[i])$pdf,col = col[i]) } dGAMMA(seq(0,1,by=0.01),5,6)$pdf #extracting the pdf values dGAMMA(seq(0,1,by=0.01),5,6)$mean #extracting the mean dGAMMA(seq(0,1,by=0.01),5,6)$var #extracting the variance #plotting the random variables and cumulative probability values col <- rainbow(4) a <- c(1,2,5,10) plot(0,0,main="Cumulative density graph",xlab="Random variable",ylab="Cumulative density values", xlim = c(0,1),ylim = c(0,1)) for (i in 1:4) { lines(seq(0,1,by=0.01),pGAMMA(seq(0,1,by=0.01),a[i],a[i]),col = col[i]) } pGAMMA(seq(0,1,by=0.01),5,6) #acquiring the cumulative probability values mazGAMMA(1.4,5,6) #acquiring the moment about zero values mazGAMMA(2,5,6)-mazGAMMA(1,5,6)^2 #acquiring the variance for a=5,b=6 #only the integer value of moments is taken here because moments cannot be decimal mazGAMMA(1.9,5.5,6)

References

\insertRef olshen1938transformationsfitODBOD

See Also

GammaDist