I’ve been hesitant in converting from JAGS to STAN explicitly because of my lack of understanding on how STAN deals with latent discrete states. This topic has gotten peripheral mention in a couple places. I was speaking with a colleague who admitted he was also waiting for some clarity before embarking on learning STAN.
I’d like to reopen this topic and hear the experience of others.
For example, consider the classic N-mixture from Kery’s book where there is a binomial observation process of some counts, with a underlying poisson process model generating those counts. Similar translated examples can be found here for Kery’s BPA book.
What if we want to track the parameter that is being marginalized? That is, the latent N in a N-mixture model? In some cases we want to know the estimated discrete state for a given observation, not just the predicted observed data generated from that latent process.
I like the idea floated by Bob and Dave here
of approximating a latent state with a normal with low variance (seems reasonable for ecological counts, animal populations etc), but what about when the states constitute the basis of a mixture model?
A verbal example,
In animal movement ecology, we might estimate the spatial coordinates of an animal movement based on the autocorrelation in step and turning lengths. We could assume that these step lengths (e.g. speed) come from some underlying discrete behavioral process (‘resting’, versus ‘foraging’), as such we might model them as a mixture model, with some prior information to avoid degeneration. I would want to know the estimated latent state per observation. I don’t want to marginalize out the latent behavioral state, but rather track that state! Is this antithetical to the STAN mindset?
Finally, even well the model is formulated in a STAN fashion, slide 39
would suggest that the effective number of samples/second is far lower? Am I reading this correctly?
PS: I would have added more links, but new users only get 2!