Show that $p(y, f(x) | x, \mathbf{w}) = p(y | x, f(x)) \; p(f(x) | \mathbf{w})$

12 Views Asked by At

I am following a lecture about polynomial regression where $x$ is the input to some process, $f(x)$ is the output of the process given it has parameters $\mathbf{w}$ and $y$ is the result of measuring $f(x)$ and applying noise.

The lecturer states that $$p(y_i|\mathbf{w},x_i) = \int p(y_i,f(x_i)|x_i,\mathbf{w})\; df(x_i) = \int p(y_i|x_i,f(x_i))\; p(f(x_i)|\mathbf{w})\; df(x_i),$$ where the probabilities in the second integral are already known.

My question is, how do you get from the contents of the first integral to the contents of the second?

I know from the product rule that $$\begin{split} p(y_i,f(x_i)|x_i,\mathbf{w}) &= \frac{p(y_i,f(x_i),x_i,\mathbf{w})}{p(x_i,\mathbf{w})} \\ p(f(x_i)|\mathbf{w}) &= \frac{p(f(x_i),\mathbf{w})}{p(\mathbf{w})} \\ p(y_i|x_i, f(x_i)) &= \frac{p(y_i,x_i,f(x_i))}{p(x_i,f(x_i))} \end{split}$$ but I don't know how to combine these to produce the answer. Appologies if my question is badly set out as this is my first time posting here.