Learn R Programming

GPB (version 1.2)

pgpb: Generalized Poisson Binomial Distribution

Description

The cdf, pmf, quantile function, and random number generator function for Generalized Poisson Binomial distribution.

Usage

pgpb(kk, pp, aval, bval, wts = NULL)
dgpb(kk, pp, aval, bval, wts = NULL)
qgpb(qq, pp, aval, bval, wts = NULL)
rgpb(m, pp, aval, bval, wts = NULL)
gpb.args.check(pp, aval, bval, wts)

Arguments

kk

The values where the cdf or pmf to be evaluated.

pp

The vector for \(p_k\)'s which are the sucess probabilities for indicators.

aval

The smaller possible values of each indicator, default to be 0. Integer values needed.

bval

The larger possible values of each indicator, default to be 1. Integer values needed.

wts

The weights for \(p_k\)'s. Positive integer values needed.

qq

The values where the quantile function to be evaluated.

m

The number of random numbers to be generated.

Value

Returns the cdf, pmf, quantiles, and random numbers.

References

Man. Zhang, Y. Hong, and N. Balakrishnan (2018). ``The generalized Poisson-binomial distribution and the computation of its distribution function,'' Journal of Statistical Computation and Simulation, Vol. 88, pp. 1515-1527.

R Core Team (2019). ``R: A Language and Environment for Statistical Computing,'' R Foundation for Statistical Computing, Vienna, Austria, url: https://www.R-project.org/.

Singleton, R. C. (1969). An algorithm for computing the mixed radix fast Fourier transform. IEEE Transactions on Audio and Electroacoustics, Vol. 17, pp. 93-103.

Examples

Run this code
# NOT RUN {
pgpb(kk=0:11, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2))
dgpb(kk=0:11, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2))
qgpb(qq=c(.1,.3), pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2))
rgpb(m=3, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2))

## when a, b share large common dividers, the results of following cases is the same
pgpb(kk=c(60,70,80,90), pp=c(.1, .2, .3), aval=c(10,20,30), bval=c(20,30,40), wts=c(1,1,1))
pgpb(kk=6:9, pp=c(.1, .2, .3), aval=c(1,2,3), bval=c(2,3,4), wts=c(1,1,1))

## when a, b are non-integer values, the values of kk, aval, bval can multiply powers of 10
aval=c(0.1,0.2,0.3)*10
bval=c(0.2,0.3,0.4)*10
kk=(0.6*10):(1.0*10)
pgpb(kk=kk, pp=c(.1, .2, .3), aval=aval, bval=bval, wts=c(1,1,1))

# }

Run the code above in your browser using DataLab