zinb.loglik.dispersion: Log-likelihood of the zero-inflated negative binomial model,...

View source: R/zinb_fit.R

zinb.loglik.dispersionR Documentation

Log-likelihood of the zero-inflated negative binomial model, for a fixed dispersion parameter

Description

Given a unique dispersion parameter and a set of counts, together with a corresponding set of mean parameters and probabilities of zero components, this function computes the sum of the log-probabilities of the counts under the ZINB model. The dispersion parameter is provided to the function through zeta = log(theta), where theta is sometimes called the inverse dispersion parameter. The probabilities of the zero components are provided through their logit, in order to better numerical stability.

Usage

zinb.loglik.dispersion(zeta, Y, mu, logitPi)

Arguments

zeta

a scalar, the log of the inverse dispersion parameters of the negative binomial model

Y

a vector of counts

mu

a vector of mean parameters of the negative binomial

logitPi

a vector of logit of the probabilities of the zero component

Value

the log-likelihood of the model.

See Also

zinb.loglik.

Examples

mu <- seq(10,50,length.out=10)
logitPi <- rnorm(10)
zeta <- rnorm(10)
Y <- rnbinom(n=10, size=exp(zeta), mu=mu)
zinb.loglik.dispersion(zeta, Y, mu, logitPi)

drisso/zinbwave documentation built on March 18, 2024, 5:13 p.m.