This is an exercise from Bayesian Data Analysis

What I want to do is the first part of the exercise :

enter image description here

It is for chapter 14 of the book, an introduction to regression. I have minimal experience with regression and is the first time I see a vector being used as the mean.

I am stuck and would like your help. My goal is to solve the next exercise that uses the model from this one. So if you could help me with this one I can try on my own the next one.

So far I have that the likelihood can be written as a product $p(x) p(y|a,b)$. I know I need to find a formula for $p(y_i|a,b)$ but I am not sure how.


The data here is both $(x_i, y_i)$ and not just the $y_i$. You have been given that independently $$x_i, y_i|a, b, u_i \sim N \left((u_i \, \, a + bu_i)^T, \Sigma \right). $$

and you know that independently

$$u_i \sim N(\mu, \tau^2).$$

To find the data likelihood you need to find $p(x, y | a, b)$ \begin{align*} L(a,b) & = \prod_{i=1}^{n}p(x_i, y_i | a, b)\\ & = \prod_{i=1}^{n}\int_{u_i} p(x_i, y_i, u_i | a, b)\\ & = \prod_{i=1}^{n}\int_{u_i} p( x_i, y_i,| a, b, u_i )p(u_i)\\ \end{align*}

You can now evaluate each of the inside integrals separately. This should be not too difficult since you are dealing with Gaussian densities. This way you will have to deal with multivariate densities. If you want to break it up further it would be

$$\prod_{i=1}^{n}\int_{u_i} p( y_i,| x_i, a, b, u_i ) \,p(x_i|u_i) \,p(u_i)\\ $$

  • $\begingroup$ In a discussion with my TA, I was given the hint that $x_i$ is not related to $(a,b)$ so the likelihood $p(x,y|a,b)$ can be written as $p(y|a,b)p(x)$. That is why I think we need to find only $p(y|a,b)$. Is not this correct? After that by conditioning we need to get $p(y_i|a,b)$. How do we find the distribution of $y_i|x_i,v_i,u_i$ ? $\endgroup$ – Iniciador May 4 '16 at 23:37
  • $\begingroup$ Also what do you mean by ''since we are dealing with Gaussian densities?'' So far I've only used Normal, so gaussian in one dimension. Is there a special property to do it? Also thank you very much for the help. $\endgroup$ – Iniciador May 4 '16 at 23:42
  • $\begingroup$ @Iniciador When you expand the pdfs on there and try to integrate out $u_i$ you will find that by "completing the squares" it will be straightforward. There is no special property, I just meant that its not a difficult integration. $\endgroup$ – Greenparker May 4 '16 at 23:46
  • $\begingroup$ Got it thanks ! I will try to understand it now and work the next exercise. $\endgroup$ – Iniciador May 5 '16 at 0:02
  • $\begingroup$ Silly question: I integrate with respect to $u_i$ correct? $\endgroup$ – Iniciador May 5 '16 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.