Very interesting, and this is my first encounter with Zero Inflated Models. 👏 It's always helpful to listen to how you think aloud, and how you approach analyzing new datasets. 👍 Keep up the good work! ✨
There are multiple approaches out there for specifying models that deal with zero-inflated data. Some of them are equivalent. The following is a formulation I have used in a Bayesian probabilistic modelling approach: ``` B ~ Normal(0, 1) # Intercept parameter; std normal prior log(P) = + B # relationship between linear model and mixing probability; coefficients need priors Q ~ Bernoulli(P) # Indicator of being in zero-only subpopulation R ~ Exponential(1) # Rate parameter prior W ~ Beta(2, 2) # "success probability" prior X ~ NB(R, W) # Count from second population; sometimes zeroes occur here too. This may be interpreted as a counterfactual when Q=1. Y = (1 - Q) * X # Count from either population ``` Priors can be readily changed according to background knowledge. Some implementations allow for improper priors if desired. Just about any part this model can be modified or extended depending on the modelling problem. The above model is a mixture distribution. There are other approaches that work on a wider space of problems, but this is one of the simple starting points that I have found effective.
Is there an analogue for flexplot in Python? I've found ways to use R more at work, but I'm hesitant to make the switch because that's not what most people are using.
Thank you for an amazing video! I tried following with my own data but i got stuck on the estimates part. Basically i throws an error when i try to use the function on the zeroinfl object. I tried the development version of flexplot as well. In the video there is a cut, so I guess you had similar problem, but you dont show how you fixed it.
@@QuantPsych 100% compliment. Your model-first/early after visual inspection helped confirm a gut feeling that I never found any supportive evidence for. Also, lmer/glmer capabilities are still truly underestimated by big "AI-everything" consulting firms that default an an ML or NN solution for every problem.
Thank you for Flexplot and your videos ❤
Very interesting, and this is my first encounter with Zero Inflated Models. 👏
It's always helpful to listen to how you think aloud, and how you approach analyzing new datasets. 👍
Keep up the good work! ✨
Fantastic topic!
There are multiple approaches out there for specifying models that deal with zero-inflated data. Some of them are equivalent.
The following is a formulation I have used in a Bayesian probabilistic modelling approach:
```
B ~ Normal(0, 1) # Intercept parameter; std normal prior
log(P) = + B # relationship between linear model and mixing probability; coefficients need priors
Q ~ Bernoulli(P) # Indicator of being in zero-only subpopulation
R ~ Exponential(1) # Rate parameter prior
W ~ Beta(2, 2) # "success probability" prior
X ~ NB(R, W) # Count from second population; sometimes zeroes occur here too. This may be interpreted as a counterfactual when Q=1.
Y = (1 - Q) * X # Count from either population
```
Priors can be readily changed according to background knowledge. Some implementations allow for improper priors if desired. Just about any part this model can be modified or extended depending on the modelling problem.
The above model is a mixture distribution. There are other approaches that work on a wider space of problems, but this is one of the simple starting points that I have found effective.
Is there an analogue for flexplot in Python? I've found ways to use R more at work, but I'm hesitant to make the switch because that's not what most people are using.
Not that I know of.
Thank you for an amazing video!
I tried following with my own data but i got stuck on the estimates part. Basically i throws an error when i try to use the function on the zeroinfl object. I tried the development version of flexplot as well. In the video there is a cut, so I guess you had similar problem, but you dont show how you fixed it.
When did you last update flexplot? I just recently fixed things, but not in the development version.
@@QuantPsych I have just reinstalled stable version of flexplot and it still does not work.
@@QuantPsych Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class ‘"function"’ to a data.frame is the error i get
This channel's ego is zero inflated :) Traffic accident data is where I first came across zero inflated data.
I'm not sure if that's a compliment or an insult...but...thank you?
@@QuantPsych 100% compliment. Your model-first/early after visual inspection helped confirm a gut feeling that I never found any supportive evidence for. Also, lmer/glmer capabilities are still truly underestimated by big "AI-everything" consulting firms that default an an ML or NN solution for every problem.