Skip to content

Add 3 N-mixture variations, fix *HMM C++/R rounding error

Compare
Choose a tag to compare
@dochvam dochvam released this 05 May 17:44
· 64 commits to master since this release

In nimbleEcology 0.4.0, we add three variations of the N-mixture model. The standard version of the N-mixture model is a two-level hierarchical model where a latent state N, representing the true abundance at a site, is a Poisson random variable, and the observed count y is a binomial random variable with size N and probability p. We provide distributions for the cases where the Poisson is substituted for a negative binomial (dNmixture_BNB), the binomial is substituted for a beta binomial (dNmixture_BBP), or both (dNmixture_BBNB). These are sometimes used to represent overdispersion in the abundance or detection processes.

We implement these using an algorithm that's considerably faster than the straightforward loop over values of N, which we hope will make it feasible to use beta binomial and negative binomial N-mixtures in large data contexts.

The 0.4.0 update also addresses an issue where rounding errors in C++ compiled code caused the hidden Markov models to fail the condition that the sum of the initial state probabilities was one.