fitted value for zeroinflatedpoisson0 family

43 views
Skip to first unread message

Aria

unread,
Jul 11, 2024, 3:29:21 PM (10 days ago) Jul 11
to R-inla discussion group
Hello,

I have a question about the fitted value of a zero-inflated distribution. Here is a simple example:

>Y=list(c(0,1,1,0,0,rep(NA,5)), c(rep(NA,5),NA,2,4,NA,NA))
>covariant = data.frame(x1 = c(1:5,rep(NA,5)), x2 = c(rep(NA,5),1:5))
>model = inla(Y ~  x1 + x2, family = c("binomial","zeroinflatedpoisson0"), data=covariant, control.predictor = list(link = 2))
>model$summary.fitted.values$mean[6:10]
[1]  2.328542  2.319196  3.375467  7.179170 22.307927

I was wondering if the fitted value for the zeroinflatedpoisson0 provides the expectation of the count given that the count is greater than 0, i.e.  E(Y|Y>0). If not, what predictions does it provide?

Thank you!

Håvard Rue

unread,
Jul 12, 2024, 3:53:00 AM (10 days ago) Jul 12
to Aria, R-inla discussion group

The fitted values are as for the poisson,

fitted.values = exp(lin.predictor)

This might not be what you want for the inflated model, which have to be
computed/estimated offline, either using a plugin-approach, or through sampling,
using inla.posterior.sample() and inla.posterior.sample.eval(). There is a
vignette about its use

best
H
> --
> You received this message because you are subscribed to the Google Groups "R-
> inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/aa101f74-2418-4b53-91b6-4bfc158a9ea4n%40googlegroups.com
> .

--
Håvard Rue
hr...@r-inla.org

Aria

unread,
Jul 12, 2024, 12:54:47 PM (9 days ago) Jul 12
to R-inla discussion group

Thank you very much for your reply. I'm not sure if I'm correct. For the 'zeroinflatedpoisson0' model, I have the linear predictor log(E(Y)) and fitted.values = E(Y), where E(Y) = ∑ (1−p)*Poisson(yy>0)*y. Can I get E(YY>0) through fitted.values/(1-p), where p is given as a hyperparameter in the 'zeroinflatedpoisson0' model?

Message has been deleted

Denis Rustand

unread,
Jul 18, 2024, 5:19:56 AM (4 days ago) Jul 18
to R-inla discussion group
Hi Aria,
You can just skip the estimation of p as it seems useless in your case, it looks like you just want the truncated at zero Poisson from zeroinflatedPoisson0 likelihood. As Haavard said, the p is not taken into account for the computation of fitted values in the Poisson part, so it is not needed to "remove" its contribution there. See attached code.
Best,
Denis Rustand
he...@r-inla.org
code_ZIP.R
Reply all
Reply to author
Forward
0 new messages