Hi I am new here and I hope I can get some help.
My question is about taking expectation over random variables. Lets say I have two random variables $\Xi$ and $\theta$ where $\Xi$ is for example a poisson point process while $\theta$ is uniformly distributed random variable over $[-\pi,\pi]$. Assume that $\theta$ and $\Xi$ are independent random variables.
I have to find $$E_{\Xi,\theta}\big[ f(\theta, \Xi)\big]$$ Can I do the following $$E_{\Xi,\theta}\big[ f(\theta, \Xi)\big]= E_{\Xi} \bigg[E_{\theta}\big[f(\theta,\Xi)\big]\bigg]=E_{\Xi}\bigg[ \int_{-\pi}^{\pi}\frac{1}{2\pi}f(\theta,\Xi)d\theta\bigg] $$
My question is can I evaluate the integral inside the expectation and then take the expectation wrt to $\Xi$ or should I keep the integral over $[-\pi, \pi]$ and perform the expectation over $\Xi$ first then evaluate the integral?
Either way should work. They will be equivalent.
$$\begin{align} \mathsf E_{\Xi,\Theta}\bigg[ f(\Theta, \Xi)\bigg] & = \mathsf E_{\Xi} \bigg[\mathsf E_{\Theta}\bigg[f(\Theta,\Xi)\bigg]\bigg] & = \mathsf E_{\Theta} \bigg[\mathsf E_{\Xi}\bigg[f(\Theta,\Xi)\bigg]\bigg] \\ &=\mathsf E_{\Xi}\bigg[ \int_{-\pi}^{\pi}\frac{1}{2\pi}f(\theta,\Xi)\,\mathrm d\theta\bigg] & = \mathsf E_\Theta\bigg[\sum_{\xi=0}^\infty \frac{\lambda^\xi e^{-\lambda}}{\xi!}f(\Theta, \xi)\bigg] \\ & = \frac{1}{2\pi}\sum_{\xi=0}^\infty \left(\frac{\lambda^\xi e^{-\lambda}}{\xi!} \int_{-\pi}^{\pi}f(\theta,\xi)\,\mathrm d\theta\right) & = \frac{1}{2\pi}\int_{-\pi}^{\pi}\left(\sum_{\xi=0}^\infty \frac{\lambda^\xi e^{-\lambda}}{\xi!} f(\theta,\xi)\right)\,\mathrm d\theta \end{align}$$
Whether you integrate then sum, or sum then integrate, will depend on the function $f$ and which path it makes easiest.