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

Description Usage Arguments Value See Also Examples

View source: R/zinb_fit.R

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

1
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

1
2
3
4
5
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)

zinbwave documentation built on Nov. 8, 2020, 8:11 p.m.