I often saw a formula, used mostly to integrate on the parameter space like:
$$ p(x|y) = \int p(x|\theta) p(\theta|y) d\theta $$ where $\theta$ is the parameter.
I am confused and I hope to explain me how is that.
I know that $p(x) = \int p(x,\theta)d\theta = \int p(x|\theta)p(\theta)d\theta $. If I use a similar idea which in my mind means "a marginal distribution is obtain by integrating a join distribution over one variable", but with a conditional, I would expect to have:
$$ p(x|y) = \int p(x,\theta|y)d\theta = \int p(x|\theta,y)p(\theta|y)d\theta$$ which obviously not not look the same.
Any help with that?
Later edit: The first formula was not correct, the integration is over $\theta$. Thanks