New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generalised N-mixture models (state-space form) #173
Comments
Thanks for the detailed explanations! I will dive deeper into this model within the next week or so. As soon as I understand it thoroughly, I can tell you more if / how we can make this possible with brms. |
Nearly one year ago, I promised to respond in a week or so, which apparently I did not keep. Sorry for that. I have taken a closer look at such models, and while I really like them, I see the following problems when trying to implement them in brms: (1) The models require sampling of discrete parameters such as the latent abundance, which Stan cannot naturally handle. Their are at least two options, which are both discussed in the forum post you linked to above: Marginalizing over the discrete parameters and approximation through continuous distribution (e.g. via a normal distribution on the log-scale as in your example above). I currently don't see marginalizing to be a feasible option for these models. Using continuous distributions as approximations would certainly be an option, but we need to figure out, which approximations are most generally applicable to such models. Possibly, there are already papers out there discussing this topic. (2) The models are very specific. We need to write new In summary, I do not think implementing N-mixture models in brms would be a good idea. Rather, one should think of a separate R package (or an extention to unmarked) focusing just on such models in a Bayesian framework fitted via JAGS or Stan behind the scences. With regard to Stan, there are already quite a few R packages on CRAN, which do a great job focusing on narrow model classs suited only for a specific research setting, but providing everything users expect for such setting. |
Thanks Paul
We had come to a similar conclusion sometime ago. But appreciate your
thoughtful response.
Wishing you all the best for the festive season.
Cheers
Milani
…Sent from my iPhone
On 24 Dec 2017, at 10:06 am, Paul-Christian Bürkner ***@***.***> wrote:
Nearly one year ago, I promised to respond in a week or so, which apparently I did not keep. Sorry for that.
I have taken a closer look at such models, and while I really like them, I see the following problems when trying to implement them in brms:
(1) The models require sampling of discrete parameters such as the latent abundance, which Stan cannot naturally handle. Their are at least two options, which are both discussed in the forum post you linked to above: Marginalizing over the discrete parameters and approximation through continuous distribution (e.g. via a normal distribution on the log-scale as in your example above). I currently don't see marginalizing to be a feasible option for these models. Using continuous distributions as approximations would certainly be an option, but we need to figure out, which approximations are most generally applicable to such models. Possibly, there are already papers out there discussing this topic.
(2) The models are very specific. We need to write new family functions, for instance binomial_poisson for a N-mixture model, with binomial observered data and a poisson distribution of the latent abundance (or some continuous approximation of it). In addition, we need a new correlation structure (for argument autocor) to specify time and site variables, which will only work with these new families. This would be admittedly be a lot of work, but in general something that would be possible from the brms side. However, my concern is that such an implemention would not really satisfy anyone. Because these models are very specific, it would require much special case coding, which made brms much harder to maintain in the future. Given its current flexibility this is already a non-trivial task to date. Also the rather basic models, which could make it into brms, will likely not satisfy most researchers: They will expect and require some of the more complex forms, for instance those with colonization and extinction parameters. The number of options in unmarked::pcountOpen provides a clear picture of how complex such models can get.
In summary, I do not think implementing N-mixture models in brms would be a good idea. Rather, one should think of a separate R package (or an extention to unmarked) focusing just on such models in a Bayesian framework fitted via JAGS or Stan behind the scences. With regard to Stan, there are already quite a few R packages on CRAN, which do a great job focusing on narrow model classs suited only for a specific research setting, but providing everything users expect for such setting.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Paul
Preamble:
Further to previous conversation (and the following depends on whether brms is configured to allow for 2 separate linear predictor functions on the same response value (hence the state-space formulation)). Stan can do this but can brms be brought to bear on formulating the model for Stan. If it can then that provides a very powerful frontend to Stan for implementing a wide range of demographic models with the full Bayesian inference machinery and modelling support like various likelihoods (ziP, ZiNB, etc) and nonparametric (GAM) covariate functional form on either or both the state and observation components.
The Issue:
With the bf(,part 1, part 2, ..) formula form for brm(), would it be possible to fit a state-space model formulation like in the Stan discussion here:
https://groups.google.com/forum/#!topic/stan-users/9mMsp1oB69g
part1= the latent or hidden state component, part 2 = the observation component
These so-called N-mixtures models are implemented in R at the moment via the “unmarked” package on CRAN:
Fiske, Chandler (2011) unmarked: An R package for fitting hierarchical models of wildlife occurrence and abundance. Journal of Statistical Software, 43(10):1–23, 2011
These models are used to estimate various wildlife population metrics like abundance for unmarked animals sampled at multiple sites over multiple occasions while accounting for imperfect detection.
The demographic model most people are after is the generalised N-mixture model (also known as the Dail-Madsen model and there are recent extensions). In “unmarked” that is the “pcountOpen() function"
We already fit some forms of them using JAGS/rjags but in Stan via brms might be a way better approach.
Very simple population dynamics state-space models are already fitted using Stan as in our script below for a Australia flatback marine turtle nesting population in Western Australia.
It uses some Stan code from here (https://github.com/stan-dev/example-models/tree/master/BPA)
But it is far too simple EGSS model (useful nonetheless) but importantly is limited to Gaussian likelihood - it really should be Poisson on NB likelihood (and that is the problem discussed at:
https://groups.google.com/forum/#!topic/stan-users/9mMsp1oB69g
Anyway, the N-mixture state-space population model discussed above (https://groups.google.com/forum/#!topic/stan-users/9mMsp1oB69g) could be a new frontier for brms!!
Not sure if this is possible with brms as the frontend to Stan though you are in a far far better position to know.
cheers
Milani
The text was updated successfully, but these errors were encountered: