zinb.loglik.regression: Penalized log-likelihood of the ZINB regression model

View source: R/zinb_fit.R

zinb.loglik.regressionR Documentation

Penalized log-likelihood of the ZINB regression model

Description

This function computes the penalized log-likelihood of a ZINB regression model given a vector of counts.

Usage

zinb.loglik.regression(
  alpha,
  Y,
  A.mu = matrix(nrow = length(Y), ncol = 0),
  B.mu = matrix(nrow = length(Y), ncol = 0),
  C.mu = matrix(0, nrow = length(Y), ncol = 1),
  A.pi = matrix(nrow = length(Y), ncol = 0),
  B.pi = matrix(nrow = length(Y), ncol = 0),
  C.pi = matrix(0, nrow = length(Y), ncol = 1),
  C.theta = matrix(0, nrow = length(Y), ncol = 1),
  epsilon = 0
)

Arguments

alpha

the vectors of parameters c(a.mu, a.pi, b) concatenated

Y

the vector of counts

A.mu

matrix of the model (see Details, default=empty)

B.mu

matrix of the model (see Details, default=empty)

C.mu

matrix of the model (see Details, default=zero)

A.pi

matrix of the model (see Details, default=empty)

B.pi

matrix of the model (see Details, default=empty)

C.pi

matrix of the model (see Details, default=zero)

C.theta

matrix of the model (see Details, default=zero)

epsilon

regularization parameter. A vector of the same length as alpha if each coordinate of alpha has a specific regularization, or just a scalar is the regularization is the same for all coordinates of alpha. Default=O.

Details

The regression model is parametrized as follows:

log(\mu) = A_\mu * a_\mu + B_\mu * b + C_\mu

logit(\Pi) = A_\pi * a_\pi + B_\pi * b

log(\theta) = C_\theta

where \mu, \Pi, \theta are respectively the vector of mean parameters of the NB distribution, the vector of probabilities of the zero component, and the vector of inverse dispersion parameters. Note that the b vector is shared between the mean of the negative binomial and the probability of zero. The log-likelihood of a vector of parameters \alpha = (a_\mu; a_\pi; b) is penalized by a regularization term \epsilon ||\alpha||^2 / 2 is \epsilon is a scalar, or \sum_{i}\epsilon_i \alpha_i^2 / 2 is \epsilon is a vector of the same size as \alpha to allow for differential regularization among the parameters.

Value

the penalized log-likelihood.


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