Correct likelihood expression for linear regression Suppose you want to infer slope ($\alpha$) and variance ($\sigma^2$) assuming $y = \alpha x+ \epsilon$. This is how the Bayes formula is written:
$P(\alpha, \sigma | y,x) \propto P(y,x | \alpha, \sigma) P(\alpha, \sigma)$
but when you want to model $y$ you actually write the likelihood as:
$y | \alpha, \sigma, x \sim N(\alpha x , \sigma^2)$
This is where I am confused because in the Bayes formula we have $P(y,x | \alpha, \sigma)$ but the likelihood is written as $P(y|\alpha, x, \sigma)$. I was wondering if I am missing something and how the above equations add up?

If you write the full posterior it should be
$$p(a,\sigma|y,x) = \frac{p(y,x|a,\sigma)p(a,\sigma)}{p(y,x)}=...=\frac{p(y|x,a,\sigma)p(a,\sigma)}{p(y|x)} \propto p(y|x,a,\sigma)p(a,\sigma)$$
you can derive that by simple calculations for conditional distributions. The key condition that you have to identify is if $x$ is independent or not to  $(a,\sigma)$
