# Integration step in Bayesian linear regression

I want to obtain the integral:

$$\int_{{\mathbb R}^p} \frac{1}{(2\pi)^{\frac{n}{2}}\vert\Sigma\vert^{\frac{1}{2}}}\exp\left[-\frac{1}{2}({\bf y} - {\bf X}{\beta})^{\top} \Sigma^{-1}({\bf y} - {\bf X}{\beta})\right] d\beta,$$

where ${\bf y}$ is an $n\times 1$ vector, $\beta$ is a $p\times 1$ vector, $\Sigma$ is a symmetric positive definite matrix and ${\bf X}$ is an $n\times p$ matrix. This expression is very common in Bayesian linear regression but I do not know the trick used to separate ${\bf X}$ from $\beta$ in order to obtain the integral by using its resemblance to the multivariate normal distribution.

I would appreciate any guidelines on this. Thanks.

• Aren't you integrating over $\mathbb{R}^p$? Commented Aug 27, 2013 at 10:38
• The trick is to rewrite $(y-X\beta)^T\Sigma^{-1}(y-X\beta)$ as $(y-X\hat\beta+X\hat\beta-X\beta)^T\Sigma^{-1}(y-X\hat\beta+X\hat\beta-X\beta)$ and to then rearrange terms. I'll show you how if you still have not figured it out later.
– user25658
Commented Aug 27, 2013 at 13:37
• Alternatively, you just expand out $(y-X\beta)^T\Sigma^{-1}(y-X\beta)$ as $y^T\Sigma^{-1}y -y^T\Sigma^{-1}X\beta-(X\beta)^T\Sigma^{-1}y+(X\beta)^T\Sigma^{-1}X\beta)$ then simplify and complete the square in $\beta$, which then gives you result of the form $(\beta-\hat\beta)^T\text{<something>}(\beta-\hat\beta) + S$ where $S$ doesn't contain $\beta$, and where the form of $\hat\beta$ and "<something>" are obvious by inspection of the expanded terms Commented Aug 28, 2013 at 1:00