3
$\begingroup$

I'm using Andrew Gelman's 3rd edition of Bayesian Data Analysis and am going through the exercises. For one of the exercises, he supposes that if $\theta = 1$, then $y$ has a normal distribution with mean $1$ and standard deviation $\sigma$, and if $\theta = 2$, then $y$ has a normal distribution with mean $2$ and standard deviation $\sigma = 2$. He also supposes that $\text{Pr}(\theta = 1) = \text{Pr}(\theta = 2) = 0.5$. One of the problems is to solve for $\text{Pr}(\theta = 1 | y = 1)$ and the solution, according to Gelman's solution sheet on his website, is the following:

$\text{Pr}(\theta = 1 | y = 1) = \frac{p(\theta = 1\ \cap \ y=1)}{p(\theta = 1 \ \cap \ y=1) + p(\theta = 2 \ \cap \ y = 1)} = \frac{0.5N(1|1,2^2)}{0.5N(1|1,2^2) + 0.5N(1|2,2^2)} = 0.53$

Conceptually, I understand what's going on, but I am really confused as to what $N(1|1,2^2)$ and $N(1|2,2^2)$ mean exactly and how he calculates these values.

$\endgroup$
1
  • $\begingroup$ Since this is a textbook question you're trying to learn from, you should read the info on the self-study tag and add it to your question. $\endgroup$
    – Danica
    May 2, 2015 at 6:41

1 Answer 1

1
$\begingroup$

The notation $N(1 \mid 1, 2^2)$ refers to the probability density of $y = 1$ under a normal distribution with mean 1 and variance $2^2$.

So, there are a few steps to go through here, using the basic manipulation a of probability densities that you can do. We start with

$$p( \theta = 1 \mid y = 1) = \frac{p(\theta = 1 \cap y = 1)}{p(y = 1)}$$

just by the definition of conditional probability, right? There's one more thing to do to get to the first equality from the solutions manual. Do you see what it is? Then there's another step before you can start plugging in values to get the second equality...

$\endgroup$
5
  • $\begingroup$ Thanks! Yeah if you could give some pointers on where the formula came from, that would be really helpful. Also, if you could help me to understand how to calculate this value. I assumed one used the Normal CDF but the numbers don't seem to match his. $\endgroup$
    – TSP
    May 2, 2015 at 7:13
  • $\begingroup$ @TSP I added some pointers, let me know if they helped or questions if they didn't...also, everything we're doing in this problem is with probability densities, ie pdfs. $\endgroup$
    – Danica
    May 2, 2015 at 16:47
  • $\begingroup$ Thanks! I understand how to get to the second equality, but its the plugging in values that is confusing me. For $N(1|1,2^2)$, I thought we got this by solving for $P(y \leq 1)$ by evaluating the CDF of the Normal at y = 1 with $\mu = 1$ and $\sigma = 2$. This is what I'm lost on. $\endgroup$
    – TSP
    May 2, 2015 at 18:04
  • $\begingroup$ Again, everything here is with density functions. $N(y\mid \mu, \sigma^2) = \exp \left( - (x-\mu)^2 / (2 \sigma^2) \right)$, the density function, not the CDF. $\endgroup$
    – Danica
    May 2, 2015 at 18:07
  • 1
    $\begingroup$ Thanks, this is exactly what I was looking for. Will definitely review some basics because I was really confused. Thanks again! $\endgroup$
    – TSP
    May 2, 2015 at 19:46

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.