Bayesian t-test¶
We want to test the hypothesis that \(\mu \ne \mu_0\) foro some known value \(\mu_0\) (ofthen 0), given values \(x_i \sim N(\mu, \sigma^2)\). This is called a two-sided one sample t-test. We perform this test by checking if \(\mu_0 \in I_{0.95}(\mu|D)\). If not than we can be 95% sure that \(\mu \ne \mu_0\). A more common scenario is when we want to test if two paried samples have the same mean.
We want to determine if \(\mu = \mu_1 - \mu_2 \ge 0\) using \(x_i = y_i - z_i\)
This can be evaluted as:
This is called one sided paired t-test.
To find \(p(\mu|D)\) we specify an uninformative prior the posterior marginal on \(\mu\) is T distributed:
Now we define the t-statistics as:
\(s/\sqrt{N}\) is the standard error of the mean
Thus the posterior: $\( p(\mu|D) = 1 - F_{N-1}(t) \)$
\(F_v(t)\) is the CDF of the standard Student t distribution \(T(0,1,v)\)
Connection to frequentist¶
Using uninformative prior gives us the same result as using frequentist methods.
Frequentist $\(\frac{\mu - \bar{x}}{\sqrt{s/N}}| D \sim t_{N-1}\)$
Bayesian The sampling distribution of the MLE:
The reason is that the Student T distribution is symmetric in its first two arguments
The results are similar but have different interpretation. In the Bayesian approach \(\mu\) is unknown and \(\bar{x}\) is fixed. In frequentist \(\bar{X}\) is unkown and \(\mu\) is fixed.