0 2000 4000 6000 Sampling efficiency (ESPS) Minimum 0 2000 4000 6000 Sampling efficiency (ESPS) Mean MCMC Algorithm Latent State Latent State (JAGS) Filtering Filtering (JAGS) Figure 1: Minimum and mean parameter sampling efficiencies for the Dipper model. The latent state MCMC requires MCMC sampling of 848 latent variables, in addition to the two top-level model parameters of interest. The performance of JAGS is slightly better, although both result in sampling efficiencies of roughly 100 ESPS for both parameters. NIMBLE and JAGS each require approximately four minutes to generate 100,000 samples. The filtering MCMC is implemented in NIMBLE according to (6), where only the two top- level parameters undergo MCMC sampling and runtime is reduced to 5 seconds. The mixing also improves relative to the latent state MCMC, yielding a sampling efficiency of roughly 6,000 ESPS for both parameters, a 60-fold improvement. For the Dipper model alone, we can also implement the filtering MCMC in JAGS. This is possible because (6) provides a closed form expression for the likelihood of each sight- ing history. This allows use of the “zeros-trick” (Lunn et al., 2012, p. 204-206) where a general log-likelihood expression is incorporated into a model through the mean parameter of a Poisson distribution, using an artificial zero-valued observation. Using this technique reduces JAGS runtime to 30 seconds and increases sampling efficiency of both parameters to approximately 1,500 ESPS, a 15-fold improvement relative to the latent state MCMC. Although the underlying calculations are similar to those of NIMBLE’s filtering MCMC, this 17