estim.nbinom: Internal function

Description Usage Arguments Value See Also Examples

View source: R/functions.R

Description

These functions estimate the parameters of the (zero-inflated) negative binomial distribution by applying the maximum likelihood method to the labelled observations in class 0.

Usage

1
2
3

Arguments

y

observations: numeric vector of length n

z

class labels: integer vector of length n, with entries 0, 1 and NA

gamma

offset: numeric vector of length n, or NULL

Value

These functions return a list of numerics.

See Also

These are internal functions. The user functions are mixtura and scrutor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# data simulation
n <- 100
y <- stats::rnbinom(n=n,mu=5,size=1/0.05)
y[sample(1:n,size=0.2*n)] <- 0
z <- rep(0,times=n)
gamma <- rep(1,times=n)

# parameter estimation
estim.nbinom(y,z,gamma)
estim.zinb(y,z,gamma)

rauschenberger/semisup documentation built on May 11, 2020, 4 p.m.