models, a combination of these techniques can yield several orders of magnitude improvement in sampling efficiency. This can make the analysis of such models practical, opening new possibilities for fitting complex hierarchical models. As examples we draw upon capture-recapture and from ecological statistics (for a broad review, see Lebreton et al., 2009). In capture-recapture, each animal in a study generates a capture history over multiple observational periods. These data can be modeled using discrete HMMs, where latent states may simply represent “alive” or “dead”, or in the case of multistate capture-recapture, are more detailed such as including reproductive status or location. We present a series of three examples of increasing complexity to study the tradeoffs in computational cost and MCMC mixing of several methodological approaches. Our examples include a simple Cormack-Jolly-Seber capture-recapture model (“Dipper”), a simple multistate model (“Orchid”), and a larger multistate model with thousands of embedded HMMs (“Goose”). Some of the techniques we study are already supported in existing software, however only for specific applications or particular hierarchical structures. The standalone program MARK (White and Burnham, 1999) is perhaps the industry leader for applied capture- recapture. MARK provides an application-specific MCMC algorithm for fitting multistate random effects capture-recapture models, which implements filtering over latent states to di- rectly calculate model likelihoods. MARK also supports a reduced representation of datasets with repeated observations – known as an “m-array” in capture-recapture – however only for band-recovery analyses (Brownie et al., 1985). More recently, M-SURGE (Choquet et al., 2004) was developed specifically for multistate capture-recapture. M-SURGE supports numerical integration to remove latent states, although this is used exclusively for maxi- mum likelihood estimation, and never in combination with MCMC. Furthermore, neither of these software programs expose these computational techniques for user control, nor are they applicable outside the domain of ecological capture-recapture. We make use of the NIMBLE software for specifying hierarchical models and statistical al- 4