-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
CRAN found a revdep problem with the insight
package (details below)
#679
Comments
insight
package (details below). @strengejacke, I think you are the maintainer. I need to be in an online meeting for most of today, but will try get to this in the evening if someone else hasn't already.insight
package (details below)
Seems related to easystats/modelbased#217 |
Yes, they changed something in the truncated_poisson family. I found out following (copying my response from the related glmmTMB issue): I think the problem is that for zero-inflation models, we assume that the predicted response is library(glmmTMB)
library(insight)
data("fish")
m1 <- glmmTMB(
count ~ child + camper + (1 | persons),
ziformula = ~ child + camper + (1 | persons),
data = fish,
family = truncated_poisson()
)
predict(m1, type = "response") |> head()
#> [1] 0.3747268 1.1037500 0.3747268 0.5692224 0.3747268 0.6854378
(link_inverse(m1)(predict(m1, type = "link")) * (1 - as.vector(predict(m1, type = "zprob")))) |> head()
#> [1] 0.2400130 0.9726394 0.2400130 0.4613930 0.2400130 0.6362097
linv <- family(m1)$linkinv
(linv(predict(m1, type = "link")) * (1 - as.vector(predict(m1, type = "zprob")))) |> head()
#> [1] 0.2400130 0.9726394 0.2400130 0.4613930 0.2400130 0.6362097 My question is, why is predicting the response no longer equal to predicting the count model on the link-scale, back-transform via link-inverse and multiply with the predicted zero-inflation-probability? |
This issue also might affect the way we calculate CIs for truncated families (via the simulations) |
CRAN found a revdep problem with the
insight
package (details below). @strengejacke, I think you are the maintainer. I need to be in an online meeting for most of today, but will try get to this in the evening if someone else hasn't already.Originally posted by @mebrooks in glmmTMB/glmmTMB#873 (comment)
The text was updated successfully, but these errors were encountered: