dKumBin | R Documentation |
These functions provide the ability for generating probability function values and cumulative probability function values for the Kumaraswamy Binomial Distribution.
dKumBin(x,n,a,b,it=25000)
x |
vector of binomial random variables |
n |
single value for no of binomial trial |
a |
single value for shape parameter alpha representing a |
b |
single value for shape parameter beta representing b |
it |
number of iterations to converge as a proper probability function replacing infinity |
Mixing Kumaraswamy distribution with Binomial distribution will create the Kumaraswamy 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.
P_{KumBin}(x)= ab{n \choose x} \sum_{j=0}^{it} (-1)^j{b-1 \choose j}B(x+a+aj,n-x+1)
a,b > 0
x = 0,1,2,...n
n = 1,2,3,...
it > 0
The mean, variance and over dispersion are denoted as
E_{KumBin}[x]= nbB(1+\frac{1}{a},b)
Var_{KumBin}[x]= n^2 b(B(1+\frac{2}{a},b)-bB(1+\frac{1}{a},b)^2)+
nb(B(1+\frac{1}{a},b)-B(1+\frac{2}{a},b))
over dispersion= \frac{(bB(1+\frac{2}{a},b)-(bB(1+\frac{1}{a},b))^2)}
{(bB(1+\frac{1}{a},b)-(bB(1+\frac{1}{a},b))^2)}
Defined as B(a,b)
is the beta function.
NOTE : If input parameters are not in given domain conditions necessary error messages will be provided to go further.
The output of dKumBin
gives a list format consisting
pdf
probability function values in vector form.
mean
mean of the Kumaraswamy Binomial Distribution.
var
variance of the Kumaraswamy Binomial Distribution.
over.dis.para
over dispersion value of the Kumaraswamy Distribution.
xiaohu2011kumaraswamyfitODBOD
## Not run:
#plotting the random variables and probability values
col <- rainbow(5)
a <- c(1,2,5,10,.85)
plot(0,0,main="Kumaraswamy binomial probability function graph",xlab="Binomial random variable",
ylab="Probability function values",xlim = c(0,10),ylim = c(0,0.5))
for (i in 1:5) {
lines(0:10,dKumBin(0:10,10,a[i],a[i])$pdf,col = col[i],lwd=2.85)
points(0:10,dKumBin(0:10,10,a[i],a[i])$pdf,col = col[i],pch=16)
}
## End(Not run)
dKumBin(0:10,10,4,2)$pdf #extracting the pdf values
dKumBin(0:10,10,4,2)$mean #extracting the mean
dKumBin(0:10,10,4,2)$var #extracting the variance
dKumBin(0:10,10,4,2)$over.dis.para #extracting the over dispersion value
## Not run:
#plotting the random variables and cumulative probability values
col <- rainbow(5)
a <- c(1,2,5,10,.85)
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 in 1:5) {
lines(0:10,pKumBin(0:10,10,a[i],a[i]),col = col[i])
points(0:10,pKumBin(0:10,10,a[i],a[i]),col = col[i])
}
## End(Not run)
pKumBin(0:10,10,4,2) #acquiring the cumulative probability values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.