I have a stochastic quantity (not sure if it is a proper stochastic process), defined as follows:
$$I = \int d x f(x) X(x)$$ $f(x)$ is a positive function of real variable, defined over the integral domain. $X(x)$ is a sequence of random variables, defined over $x$ as their parameter space.
In particular, their are uncorrelated, Poisson distributed, with means and variances equal to $\mu_{X}(x)$. I'm interested in the mean and variance of $I$.
Using the first and second order moments I get
$$ \text{E}[I] = \text{E}\left[\int d x f(x) X(x)\right]=\int d x f(x)\mu_{X}(x) $$ and \begin{align} \text{E}[I^2] =& \text{E}\left[\int d x f(x) X(x)\int d y f(y) X(y)\right] \\ =& \int d x d y f(x) f(y) \text{E}\left[X(x)X(y)\right] \\ =& \int d x d y f(x) f(y) \delta(x-y)\text{E}\left[X(x)^2\right]\\ =& \int d x f(x)^2 \text{E}\left[X(x)^2\right]\\ =& \int d x f(x)^2 \text{Var}\left[X(x)\right] + \text{E}\left[X(x)\right]^2 \\ =& \int d x f(x)^2 (\mu_{X}(x) +\mu_{X}(x)^2) \end{align} Although the variance of $I$
\begin{align} \text{Var}[I] =& \text{E}[I^2]-\text{E}[I]^2 \\ =& \int d x f(x)^2 (\mu_{X}(x) +\mu_{X}(x)^2)- \left(\int d x f(x)\mu_{X}(x)\right)^2 \end{align} is not necessarily positive.
Consider, e.g. $f(x) = 1$, $\mu_{X}(x)=x$, and $I$ to be defined over $[1,3]$
\begin{align} \text{Var}[I] =& \int_1^3 d x (x+x^2)- \left(\int_1^3 d x x\right)^2\\ =& - \frac{10}{3} \end{align} Any help figuring out the issue would be appreciated. A somewhat related answer is here although it actually goes in the same direction as my conclusion.