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 one complete-data unlabelled (1 + x | id) ML-Laplace correlated intercept-slope block on the log-mean (mc-0719), and 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 remain planned. Zero-inflated NB2 supports only the point-fit-only IID control bf(count ~ fixed_effects, sigma ~ 1 + (1 | group), zi ~ 1) under ML with complete responses; zero-inflated sigma predictors, slopes, labels, and other random-effect combinations remain unsupported.

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"