These functions provide the ability for generating probability function values and cumulative probability function values for the Grassia-II-Binomial Distribution.
dGrassiaIIBin(x,n,a,b)
Arguments
x: vector of binomial random variables.
n: single value for no of binomial trials.
a: single value for shape parameter a.
b: single value for shape parameter b.
Returns
The output of dGrassiaIIBin gives a list format consisting
pdf probability function values in vector form.
mean mean of the Grassia II Binomial Distribution.
var variance of the Grassia II Binomial Distribution.
over.dis.para over dispersion value of the Grassia II Binomial Distribution.
Details
Mixing Gamma distribution with Binomial distribution will create the the Grassia-II-Binomial distribution, only when (1-p)=e^(-lambda) of the Binomial distribution. The probability function and cumulative probability function can be constructed and are denoted below.
The cumulative probability function is the summation of probability function values.
#plotting the random variables and probability valuescol <- rainbow(5)a <- c(1,2,5,10,0.2)plot(0,0,main="Grassia II binomial probability function graph",xlab="Binomial random variable",ylab="Probability function values",xlim = c(0,10),ylim = c(0,0.5))for(i in1:5){lines(0:10,dGrassiaIIBin(0:10,10,a[i],a[i])$pdf,col = col[i],lwd=2.85)points(0:10,dGrassiaIIBin(0:10,10,a[i],a[i])$pdf,col = col[i],pch=16)}dGrassiaIIBin(0:10,10,4,.2)$pdf #extracting the pdf valuesdGrassiaIIBin(0:10,10,4,.2)$mean #extracting the meandGrassiaIIBin(0:10,10,4,.2)$var #extracting the variancedGrassiaIIBin(0:10,10,4,.2)$over.dis.para #extracting the over dispersion value#plotting the random variables and cumulative probability valuescol <- rainbow(4)a <-c (1,2,5,10)plot(0,0,main="Cumulative probability function graph",xlab="Binomial random variable",ylab="Cumulative probability function values",xlim = c(0,10),ylim = c(0,1))for(i in1:4){lines(0:10,pGrassiaIIBin(0:10,10,a[i],a[i]),col = col[i])points(0:10,pGrassiaIIBin(0:10,10,a[i],a[i]),col = col[i])}pGrassiaIIBin(0:10,10,4,.2)#acquiring the cumulative probability values