# Taking Expectation Over Inverse Sum of Indicator Functions?

I'm working with a zero inflated Poisson distribution that has the following pmf:

$$f(y|w,\lambda)=wI[y=0]+(1-w)\frac{e^{-\lambda}\lambda^{y}}{y!}$$

I would like to find the expectation of the following estimator:

$$\hat \lambda=\sum_i\frac{y_iI[y_i\neq 0]}{(\sum_iI[y_i\neq 0])}$$

which is the sample mean for all non-zero observations. My result is as follows:

$$E[\hat \lambda]=\sum_iE\left[\frac{y_iI[y_i\neq 0]}{(\sum_iI[y_i\neq 0])}\right]=\sum_i\sum_{y=0}^\infty\left[\frac{y_iI[y_i\neq 0]}{(\sum_iI[y_i\neq 0])}\cdot f(y|w,\lambda)\right]$$

$$= \sum_i\sum_{y=0}^\infty\left[\frac{y_iI[y_i\neq 0]}{(\sum_iI[y_i\neq 0])}\cdot wI[y=0]+\frac{y_iI[y_i\neq 0]}{(\sum_iI[y_i\neq 0])}(1-w)\frac{e^{-\lambda}\lambda^{y}}{y!}\right]$$

The numerator of the first term in the square parentheses is always zero (opposing indicator functions); but here is where my troubles start, I'm not really sure how to handle the denominator on both terms, my approach was to continue as follows:

$$= \sum_i\sum_{y=1}^\infty\left[0+\frac{y_iI[y_i\neq 0]}{(\sum_iI[y_i\neq 0])}(1-w)\frac{e^{-\lambda}\lambda^{y}}{y!}\right]=\sum_i\sum_{y=1}^\infty\left[\frac{y_i}{n_{(y>0)}}(1-w)\frac{e^{-\lambda}\lambda^{y}}{y!}\right]=\frac{n(1-w)\lambda}{n_{(y>0)}}$$

Is this correct?

• Not sure what the right expectation is, but the answer shouldn't contain the number of non-zero y's since that depends on the data. Also the answer should be greater than lambda (biased high) since all zeros are being ignored whether due to ZI or not. Jul 29, 2020 at 15:27
• The estimator is not defined when all $y_i$'s are zero. Jul 29, 2020 at 15:27
• In that case you need to include a factor of $\mathcal{I}(y \ne 0)$ in the second term of $f.$ Note, too, that an estimator cannot estimate the "sample mean:" the sample mean is not a property of the distribution. It looks like you are trying to estimate the mean of the truncated distribution for $y\ne 0.$ Is that correct?
– whuber
Jul 29, 2020 at 16:02
• Why would we need an indicator function on the second term? The pmf seems proper without it (sums to 1, non-negative everywhere). Regarding the second part; I’m trying to estimate the parameter λ, which is the mean of the second component of a mixture distribution (the second component not being a truncated distribution, since $y=0$ can also arise from the second component)
– tvbc
Jul 29, 2020 at 16:28
• Without an indicator for the second term, the probability that $y=0$ is $w + (1-w)e^{-\lambda}:$ is this really what you intended?
– whuber
Jul 29, 2020 at 20:01