13.3 Negative Binomial Distribution (log alternative parameterization)
Related to the parameterization in section negative binomial, alternative parameterization, the following parameterization uses a log mean parameter η=log(μ), defined for η∈R, ϕ∈R+, so that for n∈N, NegBinomial2Log(n|η,ϕ)=NegBinomial2(n|exp(η),ϕ). This alternative may be used for sampling, as a function, and for random number generation, but as of yet, there are no CDFs implemented for it.
13.3.1 Sampling Statement
n ~
neg_binomial_2_log
(eta, phi)
Increment target log probability density with neg_binomial_2_log_lpmf(n | eta, phi)
dropping constant additive terms.
13.3.2 Stan Functions
real
neg_binomial_2_log_lpmf
(ints n | reals eta, reals phi)
The log negative binomial probability mass of n
given log-location eta
and inverse overdispersion control phi
. This is especially useful for
log-linear negative binomial regressions.
R
neg_binomial_2_log_rng
(reals eta, reals phi)
Generate a negative binomial variate with log-location eta
and inverse
overdispersion control phi
; may only be used in transformed data and generated
quantities blocks. eta
must be less than 29log2. For a description of
argument and return types, see section vectorized function signatures.