Bayesian statistics: what is the variable we are integrating in? This is a screenshot from Bayesian Data Analysis by Gelman.
I am a little bit confused by Equation 1.4 (first and second lines), having read Equation 1.3.
In Equation 1.3, the variable of integration is $\theta$. I understand the example scenario presented of having a set of objects weighed already, $y$, on some scale with parameters $\theta$. Now that I have more objects that are yet to be weighed, $\tilde{y}$, then we want to get $p(\tilde{y}|y)$.
My questions are:

*

*Why is the first line: $\displaystyle\int p(\tilde{y},\theta|y)d\theta$. Why is it a 'joint' probability of $\tilde{y}$ and $\theta$? I understand why they are conditioned on $y$ (because these are the observations I have already. So why are they joint on $\tilde{y}$ and $\theta$?


*Can someone please show a more deliberate 'derivation' how to arrive at lines 2 and 3?


*Since the probability is conditioned on $y$, why is the variable not $y$ (or the integration be in terms of $dy$.) Why is it still $d\theta$?
Thanks for your insights.


The step in line 1 is obtaining the posterior predictive density by starting with the joint density and then "integrating out" the value $\theta$.  (This is why it is $d \theta$ and not $dy$ --- we are integrating out $\theta$, not $y$.)  The step to line 2 follows from the multiplication rule for probability densities and the step to line 3 follows from the conditional independence $\tilde{y} \ \bot \ y | \theta$.
