Skip to contents

nbinom2() defines a one-response count distribution with formulas for the mean mu and overdispersion scale sigma.

Usage

nbinom2()

Value

A drm_family object.

Details

The implemented contract is log(mu) = eta_mu, log(sigma) = eta_sigma, and Var(y) = mu + sigma^2 * mu^2. Thus larger sigma means greater extra-Poisson variation. Internally this is equivalent to the usual NB2 size parameter size = 1 / sigma^2. Ordinary non-zero-inflated NB2 models also support first-slice random intercepts on the log-sigma predictor, such as bf(count ~ x, sigma ~ z + (1 | id)). Structured sigma effects (phylo/spatial/animal/relmat) also fit as a point-recovery route (trust the point estimate, not the interval; not yet coverage-verified). NB2 sigma random slopes and zero-inflated NB2 sigma random effects remain planned.

Examples

nbinom2()
#> $name
#> [1] "nbinom2"
#> 
#> $family
#> [1] "nbinom2"
#> 
#> $n_response
#> [1] 1
#> 
#> $dpars
#> [1] "mu"    "sigma"
#> 
#> $links
#>    mu sigma 
#> "log" "log" 
#> 
#> attr(,"class")
#> [1] "drm_family"