My probability knowledge is a little rusty, and I am having some problems formulating an expression for the variance of a variable generated by two random processes.
Briefly, suppose I have red and green widgets, and these can be selected (independently) from an infinite reservoir of widgets. The probability of selecting a red widget is $p$, and a green widget is $1-p$. Some random process inserts $n$ of these widgets (selected at random according to the probabilities above) into a packet. The number of widgets inserted into a packet is governed by a Poisson distribution with mean $\lambda$. Specifically, each time the process runs a packet may get no widgets, or 1 widget (e.g. with probability $p$ of it being red), or 2 widgets (e.g. with probability $p^2$ that both are red), etc. This process can generate around 15.000 packets.
What I am interested in is estimating $p$ by observing the fraction of packets with any amount of red widgets and dividing this by the total number of packets with any widgets inside them. I can control $\lambda$. Clearly this method of approximating $p$ will be worse for larger $\lambda$, because more packets will get multiple widgets, which introduces error. If $\lambda$ is small, then most of the packets will be empty, or have a single widget only. However, in this small $\lambda$ regime, the small number of packets with anything in them might make the estimate of $p$ worse due to the small sample size... I want to analytically study this problem without resorting to simulations (which are pretty easy for this system).
Currently, I think I can calculate a mean estimate of $p$ by finding the probability of a packet having any red widgets, $w_r$,
$$ w_r = \sum_{i=1}^{\infty} \text{Poisson}(i; \lambda) \times \left(1 - \text{Binomial}(0; i, p)\right), $$
where the Binomial term comes from noting that we care about having any number of red widgets. In more detail, for a packet with two widgets, the probability of having at least 1 red widget is,
$$ \sum_{j=1}^{2} \text{Binomial}(j; 2, p)) = 1 - \text{Binomial}(0; 2, p)). $$
Finally, I can also calculate a mean estimate for the number of packets with any positive number of widgets inside them, $N$,
$$ N = \sum_{i=1}^{\infty} \text{Poisson}(i; \lambda) = 1 - \text{Poisson}(0; \lambda). $$
Thus, I think the "mean" estimate of $p$ using this approach is $\frac{w_r}{N}$. Is there a way to estimate the confidence or error of this estimate? Naively, I think this would correspond to the variance of $\frac{w_r}{N}$, but I have no idea how to calculate it... Any help would be appreciated!
If $r$ is the count of red widgets in a packet and $w$ is the total number of widgets in a packet, then
$$\mathbb{P}(r>0|w>0)=\frac{1}{1-e^{-\lambda}}\sum_{i=1}^\infty\frac{[1-(1-p)^i]\lambda^i}{i!e^\lambda}=\frac{1-e^{-p\lambda}}{1-e^{-\lambda}}$$
So the number of packets, $k$, containing at least one red widget out of $n$ packets produced with at least one widget is binomially distributed:
$$k\sim\text{Bin}\bigg(n,\frac{1-e^{-p\lambda}}{1-e^{-\lambda}}\bigg)$$
Use one of the well known methods to calculate confidence intervals or credible intervals around $\frac{1-e^{-p\lambda}}{1-e^{-\lambda}}$, then translate that to intervals around $p$.
An interesting question is how to select $\lambda$ to get the smallest interval around $p$.