I have a population of agents with a single real-valued attribute $x$. Each of them performs $n$ Bernoulli trials with success probability $q(x)$ which depends on their attribute. In particular, $$ q(x)=a \exp\left(-b x^2\right), $$ where $a\in(0,1]$ and $b>0$. The distribution that an agent with attribute value $x$ has $k$ successes is thus binomial $$ P(k\mid x)=\tbinom nk q(x)^k\left(1-q(x)\right)^{n-k}. $$
I would like to determine the distribution of successes marginalised over the attribute values of the agents, i.e. $$ P(k)=\int dx P(k\mid x)P(x), $$ where $P(x)$ is the distribution of agent attributes which I assume to be Gaussian with variance $\Sigma^2$ and mean zero. The full integral thus becomes \begin{align} P(k)&=\int dx \, P(k\mid x)P(x)\\ &=\int dx\tbinom nk \left[a \exp\left(-b x^2\right)\right]^k\left[1-a \exp\left(-b x^2\right)\right]^{n-k}\\ &\qquad\times\frac{1}{\sqrt{2\pi}\Sigma}\exp\left(-\frac{x^2}{2\Sigma^2}\right). \end{align}
It's causing me a bit of a headache. I have made the following attempts:
- Expand the term $(1-q(x))^{n-k}$ using the binomial theorem but the result is an alternating series and is numerically very badly behaved.
- Expand the term $(1-q(x))^{n-k}$ to first order in $q(x)$ because I know that $q$ is small. However, that approach is also plagued by numerical problems.
- Approximate the binomial distribution with the Poisson distribution (I know that $n$ is large) but that doesn't simplify the integration. Further approximating by a Gaussian didn't help me either.