# Probabilty estimation for Bernoulli with number of trials as random variable

#### Problem description

Suppose we have fixed number of people that are the test population, let's say $$t=200$$ persons. For each one of them $$\mathbf{r}_j$$ we know about $$m=300$$ features that describes them $$f_{i,j} \in \{0,1\}$$. So we have 200 sets of 300 0's and 1's, $$\mathbf{r}_t = (f_{1,t},f_{2,t},\dots,f_{i,j})$$, where $$i = 1, 2, \dots, t$$ and $$j=1,2,\dots,m$$.

Now suppose we know that $$s=10$$ of them are sick from an unknown disease $$d^*$$. We also know that for every considered disease $$d_k$$ only people with a unique combination of two features $$f_{k1} \cap f_{k_2}$$ from these known are exposed. So every disease could be described as a combination of two features $$d_k = [f_{k1},f_{k_2}]$$, where $$k_1\neq k_2$$ and $$k_1,k_2 \in \{1,2,\dots,m\}$$

We don't know how many persons in our test population $$r$$ were exposed, but, let's say, we have a $$w=50$$ of possible diseases $$d_k$$, $$k=1,2,\dots,w$$ to consider based on the features of our sick people.

An extra information given is an estimation of the entire population of the people that posses each feature combination and each feature $$N_f$$ and $$N_{f_{k_1} \cap f_{k_2}}$$.

I am trying to infer the most probable, possible disease $$\hat{d}$$ based on the given data. So far I considered two approach but I am not very confident that they are correct.

#### Formalization

So I am modelling the exposed people in test population as $$N_{t,d_k} = \sum_{i=1}^{t} (f_{i,k_1} \cap f_{i,k_2})$$ unknown Bernoulli trials that gives outcome the fixed number of "successes" $$s$$, 1 if sick, 0 if healthy.

$$s \sim {\sf Ber}( N_{t,d_k} , p_{d_k})$$, with probability of each exposed person to get sick equal to $$p_{d_k} \in [0,1]$$ and unknown.

#### Approach (1)

I consider the disease with the Maximum Likelihood Estimation (MLE) as more probable. $$\hat{d}_\mathrm{MLE} = \mathrm{arg} \max_d \mathcal{L}(\theta_d) \\ =\mathrm{arg} \max_{k=1,\dots,w}{\theta_{d_k}}^s(1-\theta_{d_k})^{(N_{t,d_k} - s)}$$, where for the unknown parameter $$\theta$$, I have tried different assumptions.

1. $$\theta_{d_k} = \frac{S}{N_{f_{k_1} \cap f_{k_2}}}$$, where $$S$$ is an arbitrary number I choose and represents the sick people in the total population.
2. $$\theta_{d_k} = \frac{s}{N_{t,d_k}}$$, i.e. the ratio of sick people to exposed in the test population.

#### Approach (2)

I consider the disease with the Maximum A Posteriori (MAP) as more probable. $$\hat{d}_\mathrm{MAP} = \mathrm{arg} \max_d \pi_\Theta(\theta_d)\mathcal{L}(\theta_d)$$, where for the posterior $$\pi_\Theta(\theta_d)$$ I use a Beta distribution $${\sf Beta}(\alpha,\beta)$$. But I have a hard time setting the right parameters $$\alpha$$ and $$\beta$$.

#### Other approach

A colleague proposed that I should try to estimate the total sick people $$S$$ using an E-M algorithm but I am not sure how to implement?

Do you might have another approach to propose?