# Is this estimator biased or unbiased?

A random variable X constructed as follows:

$$X = \sum_{i=1}^{N} Z_i \$$ where $$N$$~Poisson$$(\lambda)$$ with $$\lambda > 0,\space$$ and$$\space$$ {$${{Z_i}}$$}$$^N_{i=1}$$ is an independent and identically distributed sample of size N from a Poisson distribution with mean $$\theta$$.

I have calculated the methods of moment estimator to be $$\hat{\theta} = \frac{\bar{X}}{\lambda}$$ .What is the bias?

I have attached a graph of bias against sample size that i have run through r.

$$E[X]= \theta\cdot\lambda$$

I think it is biased however I am not really sure.

• Intuitively, this is a situation where you have a random sample yet its size $N$ was not determined, but instead is itself random (in a way that is unrelated to the sample results themselves). Thus, if you use an estimator that is unbiased for any possible sample size, it must be unbiased for a random sample size.
– whuber
Oct 16, 2020 at 14:49

## 1 Answer

It's unbiased.

$$E\left[\frac{X}{\lambda}\right]=E\left[\frac{X}{N}\cdot\frac{N}{\lambda}\right]=E_N\left[E\left[\frac{X}{N}\cdot\frac{N}{\lambda}\middle| N\right] \right]$$

Now $$E\left[\frac{X}{N}\cdot\frac{N}{\lambda}\middle| N=n\right]=E\left[\frac{X}{n}\cdot\frac{n}{\lambda}\right]=\theta\frac{n}{\lambda}$$

So $$E\left[\frac{X}{\lambda}\right]=E_N[\theta N/\lambda]=(\theta/\lambda) E_N[N]=\theta$$

Compare to simulation

f<-function(lambda,theta){N<-rpois(1,lambda);X<-sum(rpois(N,theta));X/lambda}
> mean(replicate(10000,f(2,3)))
[1] 2.9898
> mean(replicate(10000,f(lambda=2,theta=3)))
[1] 3.0124
> mean(replicate(10000,f(lambda=2,theta=30)))
[1] 30.02235
> mean(replicate(10000,f(lambda=20,theta=3)))
[1] 3.01312
> mean(replicate(10000,f(lambda=0.2,theta=3)))
[1] 2.9835