I'd like to calculate Bayes Factor for two-sample t-test $H_0: \mu_1=\mu_2$ (model $M_0$) against $H_1: \mu_1\not=\mu_2$ (model $M_1$)
My data are: $x_1,x_2,\ldots, x_{n_1}\sim N(\mu_1, \sigma)$ and $y_1,y_2,\ldots, y_{n_2}\sim N(\mu_2, \sigma)$
BF is a ratio of two marginal likelihoods, so I have to get $$M_H=\int_{\mu\in M_1} f_H(\mu;y)p_H(\mu)d\mu,$$ where $M_i$ is a parameter space under hypothesis $H_0$ or $H_1$, $f_H$ is a probability density function of the data under hypothesis $H$, $p_H$ is a prior distribution on the parameters.
I need to choose prior on $\mu$ (and I do this later) and also let's assume that $\sigma$ is known and equal to both groups (for ease of calculations). The point which I stuck in is how to calculate likelihood for two groups coming from different distributions.
\begin{align} L(\mu_1, \mu_2&| x_1,\ldots, x_{n_1},y_1,\ldots,y_{n_2})\\ &=\prod_{i=1}^{n_1}\frac{1}{\sqrt{2\sigma^2\pi}}\cdot\exp\big\{-\frac{(x_i-\mu_1)^2}{2\sigma^2}\big\}\times\prod_{i=1}^{n_2}\frac{1}{\sqrt{2\sigma^2\pi}}\cdot\exp\big\{-\frac{(y_i-\mu_2)^2}{2\sigma^2}\big\}\\ &= (2\sigma^2\pi)^{\frac{-n_1}{2}}\cdot\exp\big\{{-\frac{1}{2\sigma^2}{\sum_{j=1}^{n_1}(x_j-\mu_1)^2}}\big\}\cdot (2\sigma^2\pi)^{\frac{-n_2}{2}}\cdot\exp\big\{{-\frac{1}{2\sigma^2}{\sum_{j=1}^{n_2}(y_j-\mu_2)^2}}\big\}\\ &= (2\sigma^2\pi)^{-\frac{n_1+n_2}{2}}\cdot\exp\left\{{-\frac{1}{2\sigma^2} ({\sum_{j=1}^{n_1}(x_j-\mu_1)^2}-\frac{1}{2\sigma^2}{\sum_{k=1}^{n_2}(y_k-\mu_2)^2}})\right\} \end{align}
The questions are:
- Is it ... Am I horribly wrong or something?
- Is it correct likelihood function for two groups form different normal distributions?
- How to apply prior to this?
I don't want to reparametrize or place prior on effect size.