nbinom2: Family functions for glmmTMB

Description Usage Arguments Details Value References

View source: R/family.R

Description

Family functions for glmmTMB

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
nbinom2(link = "log")

nbinom1(link = "log")

compois(link = "log")

truncated_compois(link = "log")

genpois(link = "log")

truncated_genpois(link = "log")

truncated_poisson(link = "log")

truncated_nbinom2(link = "log")

truncated_nbinom1(link = "log")

beta_family(link = "logit")

betabinomial(link = "logit")

tweedie(link = "log")

ziGamma(link = "inverse")

Arguments

link

(character) link function for the conditional mean ("log", "logit", "probit", "inverse", "cloglog", "identity", or "sqrt")

Details

If specified, the dispersion model uses a log link. Denoting the variance as V, the dispersion parameter as phi=exp(eta) (where eta is the linear predictor from the dispersion model), and the predicted mean as mu:

gaussian

(from base R): constant V=phi

Gamma

(from base R) phi is the shape parameter. V=mu*phi

ziGamma

a modified version of Gamma that skips checks for zero values, allowing it to be used to fit hurdle-Gamma models

nbinom2

Negative binomial distribution: quadratic parameterization (Hardin & Hilbe 2007). V=mu*(1+mu/phi) = mu+mu^2/phi.

nbinom1

Negative binomial distribution: linear parameterization (Hardin & Hilbe 2007). V=mu*(1+phi)

truncated_nbinom2

Zero-truncated version of nbinom2: variance expression from Shonkwiler 2016. Simulation code (for this and the other truncated count distributions) is taken from C. Geyer's functions in the aster package; the algorithms are described in this vignette.

compois

Conway-Maxwell Poisson distribution: parameterized with the exact mean (Huang 2017), which differs from the parameterization used in the COMPoissonReg package (Sellers & Shmueli 2010, Sellers & Lotze 2015). V=mu*phi.

genpois

Generalized Poisson distribution (Consul & Famoye 1992). V=mu*exp(eta). (Note that Consul & Famoye (1992) define phi differently.) Our implementation is taken from the HMMpa package, based on Joe and Zhu (2005) and implemented by Vitali Witowski.

beta

Beta distribution: parameterization of Ferrari and Cribari-Neto (2004) and the betareg package (Cribari-Neto and Zeileis 2010); V=mu*(1-mu)/(phi+1)

betabinomial

Beta-binomial distribution: parameterized according to Morris (1997). V=mu*(1-mu)*(n*(phi+n)/(phi+1))

tweedie

Tweedie distribution: V=phi*mu^p. The power parameter is restricted to the interval 1<p<2. Code taken from the tweedie package, written by Peter Dunn.

Value

returns a list with (at least) components

family

length-1 character vector giving the family name

link

length-1 character vector specifying the link function

variance

a function of either 1 (mean) or 2 (mean and dispersion parameter) arguments giving a value proportional to the predicted variance (scaled by sigma(.))

References


glmmTMB documentation built on Sept. 20, 2021, 5:07 p.m.