-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
feature suggestion: posterior probability of being in the zero-inflation state #1551
Comments
I am a bit confused. What is the difference of your suggestion to just predicting zi directly via |
This refers to a situation where we care about the posterior probability that a particular observation arises from the latent zero-inflation state. This probability of being in the zero-inflation state is zero given an observed nonzero, and is higher than |
I don't fully understand the when this is needed. So posterior_epred(dpar = "zi") give the posterior predicted probability for any (new) observation given predictors. You make it sound as if we now additionally condition the predcictions on (new?) observed data. Or am I misunderstanding something. |
You're absolutely correct that we're conditioning on the observed data (not necessarily new data; the commoner use case will be the data used in model fitting). I think what you're missing is why this can be useful :) Sometimes with these zero-inflated models, we actually want inference, row-wise, on which observations came from the zero-inflation process. In other words, we want to "un-marginalize" over the latent discrete state A good concrete example is an occupancy model fitted as a zero-inflated binomial or zero-inflated beta-binomial (but I don't think the use cases for this are restricted to occupancy modeling). A common goal in inference from an occupancy model is to get a posterior distribution for occupancy across the actual study sites (usually not new data, but the actual sites used in fitting). That is, we want a posterior distribution, per site, of what the probability is that that side is occupied, conditioning on the observed data. Let Is that clarifying? In an occupancy modeling context, this is useful in case we want to report (posterior distributions for) descriptive statistics of the set of occupied sites, or in general compute any derived quantity based on Edit: a final note is that when we desire inference about the posterior distribution for |
Just a note on naming: I guess |
Thank you for explaining. So this is basically getting the conditional mixture weights per observation? If so, perhaps we can generalize pp_mixture to not only work with formal mixture models (created via |
Sounds good. Note that in hurdle models the mixture weights are always either 0 or 1 and depend only on data, with no dependency on parameters. Do you think it's worthwhile to enable |
Yeah, that make sense. For consistency, it could still be nice to have the hurdle models still even though the answer is trivial. |
Edge case: what is the desired return of
I tried checking if the behavior is already defined for nested mixtures in
My instinct is not to return the zero-inflation mixture weights at all and just return the weights of the explicitly defined (via |
I think we should have an argument that needs to be turned on explicitely for zi/hu models to be used directly within pp_mixture. This way we ensure that the functions behavior does not change too much just based on the input without explicit user intervention. |
I wrote the following function to predict the posterior probability of being in the zero-inflation state for the discrete zero-inflated families in
brms
. If of interest, I'll submit a PR with doc + tests.The text was updated successfully, but these errors were encountered: