LPsmooth (version 0.1.0)

dmixnegbinom: Probability mass function of a mixture of negative binomials

Description

Computes the probability mass function of a mixture of the negative binomials.

Usage

dmixnegbinom(x, pis, size, probs)

Arguments

x

A scalar or vector of non-negative integer values.

pis

A vector collecting the mixture weights. See details.

size

A postive value corresponding to the target for number of successful trials.

probs

A vector collecting the probabilities of success for each mixture component.

Value

Value of the probability mass function of the mixture of negative binomials evaluated at x.

Details

The argument pis is a vector with length equal the number of components in the mixture. The vector pis must sum up to one, e.g. c(0.7, 0.2, 0.1). All the negative binomials contributing to the mixture are assumed to have the same size.

See Also

rmixtruncnorm, dmixtruncnorm, rmixnegbinom, find_h_disc.

Examples

Run this code
# NOT RUN {
xx<-seq(0,30,length=31)
dmixnegbinom(xx,pis=c(0.3,0.6,0.1),size=25,probs=c(0.3,0.4,0.2))

# }

Run the code above in your browser using DataLab