BI: The Binomial distribution with overdispersion

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Density and random generation for the binomial distribution with optional dispersion parameter calculation.

Usage

1
2
dBI(n,p,phi)
rBI(k,n,p,phi)

Arguments

k

number of simulations.

n

the maximum score of the binomial trials.

p

the probability of scoring a success in each binomial trial.

phi

the dispersion parameter of the binomial distribution. If phi=1, then the simple binomial model will be performed.

Details

The inclusion of a dispersion parameter in the variance equation of the binomial distribution relaxes the relationship that is expected between the mean and variance in binomial models,

E[y]=np, \quad Var[y]=φ np(1-p).

The density function of this binomial model is calculated considering as an exponential family, where the density function has the following form

f(y)=\frac{y log(p/(1-p))+n log(1-p)}{φ}+c(y,φ),

where c(y,φ) is a function that is approximated by the deviance of the model.

Value

dBI gives the density of a binomial distribution for those n, p and phi parameters.

rBI generates k random observations based on a binomial distribution with those n, p and phi parameters.

Author(s)

Josu Najera Zuloaga

Dae-Jin Lee

References

Pawitan Y. (2001): In All Likelihood: Statistical Modelling and Inference Using Likelihood, Oxford University Press.

See Also

The rbinom function of package <stats>. This function performs simulations based on a binomial distribution without dispersion parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
k <- 1000
n <- 10
p <- 0.765
phi <- 4.35

#simulating
y <- rBI(k,n,p,phi)
y

#density function
d <- dBI(n,p,phi)
d

idaejin/HRQoL documentation built on May 18, 2019, 2:32 a.m.