# what is the step by step procedure of updating a posterior probability with new data coming in

I have a question about how to update posterior probability sequentially when new data comes in sequentially by say $$x_1$$, then $$x_2$$, then $$x_3$$,.... I understand this form when the first data $$x_1$$ comes in (this very first updating is based on the Baye's formula):

$$p(\theta |x_1) = \frac{p(x_1|\theta) * p(\theta)}{\int p(x_1|\theta) *p(\theta) d\theta}$$

But how about when $$x_2$$ is coming in next now? what would be the updating looks like now? could someone gives me step by step procedures?

because I see a form like this when the sixth data ($$x_6$$) is included:

$$p(\theta|x_1,x_2,...,x_6)=\frac{p(x_2,x_3,...,x_6|\theta) *p(\theta|x_1)}{\int p(x_2,x_3,...,x_6|\theta)*p(\theta|x_1)d\theta}$$

But I couldn't understand how it arrives.

Could someone shows me how to go from the very first updating, to the form of $$p(\theta|x_1,x_2)$$ ? because I think once I know how to update the posterior from $$x_1$$ to $$x_2$$, then I would be able to figure out how to reach the posterior when the sixth data $$x_6$$ is included.

Thank you

• you will get a better answer if you outline how you calculate your posterior or what your model is Aug 26, 2019 at 7:04

If the samples are iid given the parameters, e.g. $$x_i$$ are coin tosses and $$\theta=p=P(\text{Head})$$, then $$p(x_2|x_1,\theta)=p(x_2|\theta)$$ and we'll use this fact below: \begin{align}p(\theta|x_1,x_2)&=\frac{p(x_2|\theta,x_1)p(\theta|x_1)p(x_1)}{\int p(x_2|\theta,x_1)p(\theta|x_1)p(x_1) d\theta}=\frac{p(x_2|\theta,x_1)p(\theta|x_1)}{\int p(x_2|\theta,x_1)p(\theta|x_1)d\theta}\\&=\frac{p(x_2|\theta)p(\theta|x_1)}{\int p(x_2|\theta)p(\theta|x_1)d\theta}\end{align}