loglikelihood.zigp {ZIGP}R Documentation

Log Likelihood of ZIGP distribution

Description

'loglikelihood.zigp' calculates the log likelihood function of the ZIGP distribution.

Usage

loglikelihood.zigp(delta)

Arguments

delta a parameter vector of length (p+r+q) with dim(X) = (n x p), dim(W) = (n x r), dim(Z) = (n x q). Create delta by pasting 'delta <- c(beta, alpha, gamma)'. beta is the vector of regression parameters for the mean modelling. alpha is the vector of regression parameters for overdispersion modelling. gamma is the vector of regression parameters for the ZI modelling.

Details

The design matrices have to be defined as X (for mean), W (for overdispersion) and Z (for ZI).

n has to be defined as the number of observations dim(X)[1].

k.beta has to be defined as the length of beta.

k.alpha has to be defined as the length of alpha.

k.gamma has to be defined as the length of gamma.

Y has to be defined as the response vector.

t.i has to be defined as the exposure.

Examples

Y <- c(3,0,2)
X <- matrix(c(1:3,4,3,5),3,2)
W <- c(3,-4,-1)
Z <- rep(1,3)
n <- dim(X)[1]
t.i <- rep(1,n)
beta  <- c(5,-2)
alpha <- 3.4
gamma <- -10
k.beta <- length(beta)
k.alpha <- 1
k.gamma <- length(gamma)
delta <- c(beta,alpha,gamma)
loglikelihood.zigp(delta)
#[1] 160.2377

[Package ZIGP version 2.1 Index]