Learn R Programming

QuasiSeq (version 1.0-11-0)

negbin: Negative Binomial Family

Description

This is an extension of the negbin in the mgcv package, providing additional components related to the negative binomial distribution with log link.

Compared to negbin followed by a call to fix.family.link in the mgcv package this function provides a different implementation of linkinv, added a component initializers of initialization expressions, added the third and fourth order cumulant functions cumulant3 and cumulant4.

Usage

negbin(link = "log", overdisp = stop("'overdisp' must be specified"))

Value

A list of class c("fbrNBfamily", "family"), containing all components from the mgcv::negbin followed by a call to

fix.family.link with the following additional components:

setTheta

A function setting the overdispersion parameter to a specified value. The input argument to this function is 1/overdisp.

cumulant3

A function returning the third cumulant of the distribution. Input arguments are the mean mu and variance var.

cumulant4

A function returning the fourth cumulant of the distribution. Input arguments are the mean mu and variance var.

initializers

A list of expressions that can be used to provide starting values for iterative fitting. See the initialize component of the result from family.

Arguments

link

The link funciton. Only 'log' is supported currently.

overdisp

A positive overdispersion parameter. This is the same as 1/size, where size is the same as in dnbinom.

Examples

Run this code
 negbin('log', 1)

Run the code above in your browser using DataLab