BI: The Binomial distribution with optional Dispersion Parameter

BIR Documentation

The Binomial distribution with optional Dispersion Parameter

Description

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

Usage

dBI(m,p,phi)
rBI(k,m,p,phi)

Arguments

k

number of simulations.

m

number of trials in each binomial observation.

p

probability parameter of the binomial distribution.

phi

dispersion parameter of the binomial distribution. If phi=1, the binomial distribution without dispersion parameter will be considered. Default 1.

Details

The binomial distribution belongs to the exponential family of distributions. Consequenlty, although the usual binomial distribution only consists of two paramters, an additional dispersion parameter can be included. The inclusion of a dispersion parameter softens the relationship between the expectation and variance that the binomial distribution keeps, i.e. the model allows overdispersion to be included,

E[y]=mp, Var[y]=phi*mp(1-p).

The density function of the binomial distribution with dispersion parameter is based on the exponential family approach and it is defined as

f(y)=exp\{[y*log(p/(1-p))+m*log(1-p)]/phi+c(y,phi)\},

where c() is a function that it is approximated with the deviance of the model by quadratic approximations of the log-likelihood function.

Value

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

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

Author(s)

J. Najera-Zuloaga

D.-J. Lee

I. Arostegui

References

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

See Also

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

Examples

k <- 1000
m <- 10
p <- 0.765
phi <- 4.35

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

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

#plot the simulated variable and fit the density
hist(y,col="lightgrey")
lines(seq(0,m),k*d,col="blue",lwd=2)

PROreg documentation built on July 12, 2022, 5:06 p.m.

Related to BI in PROreg...