# Derivation of Bayesian Posterior

Simple question here about deriving posteriors.

Suppose I have some likelihood in mind for my data, $p(y|\theta)$, and I also have a particular conjugate prior in mind $p(\theta)$.

Now, I have obtained a single observation, $y_1$, which I use to update my prior into a posterior: $p(\theta|y_1) \propto p(y_1|\theta) p(\theta)$.

Now suppose I have more data points, say three in total $\{y_1, y_2, y_3\}$. I'm now interested in the posterior $p(\theta| y_1, y_2, y_3)$ which might commonly be written as $\prod_{i=1}^3 p(y_i|\theta) p(\theta)$ if each data point were drawn independently.

My question is how to carry out this product - is it just over the likelihood or also the prior? That is, should I think of the posterior as

(i) $p(\theta|y_N) \propto p(\theta) \prod_{i=1}^3 p(y_i|\theta)$

or

(ii) $p(\theta|y_N) \propto p(\theta)^3 \prod_{i=1}^3 p(y_i|\theta)$ ?

That is, do I multiply by the prior probability 3 times?

It's (i). Think about the typical formula when you think of $y$ as your complete data vector:
$p(\theta|y) \propto p(\theta) p(y|\theta)$ $= p(\theta) \prod\limits_{i=1}^{n} p(y_i|\theta)$
• great thanks! I typically see the notation $p(\theta|y) \propto \prod_i p(y_i|\theta) p(\theta)$, so my uncertainty was about the extent of that product operation, but I guess another way to look at it is that the product is indexed by $i$ and so is the data $y_i$, but nothing in the prior is indexed by that product operation. Jan 8, 2015 at 13:21