pBetaCorrBin: Beta-Correlated Binomial Distribution

Description Usage Arguments Details Value References Examples

View source: R/BetaCorrBin.R

Description

These functions provide the ability for generating probability function values and cumulative probability function values for the Beta-Correlated Binomial Distribution.

Usage

1
pBetaCorrBin(x,n,cov,a,b)

Arguments

x

vector of binomial random variables

n

single value for no of binomial trials

cov

single value for covariance

a

single value for alpha parameter

b

single value for beta parameter

Details

The probability function and cumulative function can be constructed and are denoted below

The cumulative probability function is the summation of probability function values

x = 0,1,2,3,...n

n = 1,2,3,...

-∞ < cov < +∞

0< a,b

0 < p < 1

p=\frac{a}{a+b}

Θ=\frac{1}{a+b}

The Correlation is in between

\frac{-2}{n(n-1)} min(\frac{p}{1-p},\frac{1-p}{p}) ≤ correlation ≤ \frac{2p(1-p)}{(n-1)p(1-p)+0.25-fo}

where fo=min (x-(n-1)p-0.5)^2

The mean and the variance are denoted as

E_{BetaCorrBin}[x]= np

Var_{BetaCorrBin}[x]= np(1-p)(nΘ+1)(1+Θ)^{-1}+n(n-1)cov

Corr_{BetaCorrBin}[x]=\frac{cov}{p(1-p)}

NOTE : If input parameters are not in given domain conditions necessary error messages will be provided to go further

Value

The output of pBetaCorrBin gives cumulative probability values in vector form.

References

Paul, S.R., 1985. A three-parameter generalization of the binomial distribution. Communications in Statistics - Theory and Methods, 14(6), pp.1497-1506.

Available at: http://www.tandfonline.com/doi/abs/10.1080/03610928508828990 .

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#plotting the random variables and probability values
col<-rainbow(5)
a<-c(9.0,10,11,12,13)
b<-c(8.0,8.1,8.2,8.3,8.4)
plot(0,0,main="Beta-Correlated 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,dBetaCorrBin(0:10,10,0.001,a[i],b[i])$pdf,col = col[i],lwd=2.85)
points(0:10,dBetaCorrBin(0:10,10,0.001,a[i],b[i])$pdf,col = col[i],pch=16)
}
dBetaCorrBin(0:10,10,0.001,10,13)$pdf      #extracting the pdf values
dBetaCorrBin(0:10,10,0.001,10,13)$mean     #extracting the mean
dBetaCorrBin(0:10,10,0.001,10,13)$var      #extracting the variance
dBetaCorrBin(0:10,10,0.001,10,13)$corr     #extracting the correlation
dBetaCorrBin(0:10,10,0.001,10,13)$mincorr  #extracting the minimum correlation value
dBetaCorrBin(0:10,10,0.001,10,13)$maxcorr  #extracting the maximum correlation value

#plotting the random variables and cumulative probability values
col<-rainbow(5)
a<-c(9.0,10,11,12,13)
b<-c(8.0,8.1,8.2,8.3,8.4)
plot(0,0,main="Beta-Correlated binomial probability function graph",xlab="Binomial random variable",
ylab="Probability function values",xlim = c(0,10),ylim = c(0,1))
for (i in 1:5)
{
lines(0:10,pBetaCorrBin(0:10,10,0.001,a[i],b[i]),col = col[i],lwd=2.85)
points(0:10,pBetaCorrBin(0:10,10,0.001,a[i],b[i]),col = col[i],pch=16)
}
pBetaCorrBin(0:10,10,0.001,10,13)      #acquiring the cumulative probability values

Amalan-ConStat/R-fitODBOD documentation built on Oct. 1, 2018, 7:13 p.m.