# Bayesian Inference applied to a time series

I am trying to better understand how Bayesian Inference can be used.

Let's assume I am measuring a given property, $\theta$, of some material. I have done 100 measurements. These had a Gaussian distribution with some mean $u$ and std. dev. $s$. This represents my 'prior' information, $P(D)$. Now I have done 10 more measurements. To get the posterior, $P(\theta|D)$, I need first to find the likelihood, $P(D|\theta)$ (the normalization is, at least numerically, easy).

So, practically, how can I obtain the likelihood?

P.S. let's keep it general and not assume that the likelihood is also Gaussian, i.e. conjugate to the prior.

• Answers thus far assume independence. The title here specifies a time series, where rather dependence is typically assumed. Commented Mar 26, 2015 at 16:31

You say "I have done 100 measurements. These had a Gaussian distribution with some mean $u$ and std. dev. $s$". Assuming independence, the translation of this statement is $$D_i \stackrel{ind}{\sim} N(u,s^2)$$ and thus $$p(D|\theta) = \prod_{i=1}^n (2\pi s^2)^{-1/2} \exp\left(-(D_i-m)^2/2s^2 \right)$$ where $D=(D_1,\ldots,D_n)$ with $n=100$ and $\theta=(m,s)$. Now you need to assign a prior to $\theta$, i.e. $p(\theta)$ and the posterior is $$p(\theta|D) \propto p(D|\theta)p(\theta).$$ Depending on the form of this prior, it may or may not be conjugate.
Assuming that the measurement are independent, this is merely a product of as many $P(x_i|\theta)$ as individual measurements $i=1,...,10$ and where $\theta$ is the fixed parameter. The probability distribution here is your Gaussian with the parameters from $\theta$. To avoid problems multiplying many small values, you can sum logs of each $P(x_i|\theta)$.