2
$\begingroup$

Just started to study Bayesian Statistics. I am very confused the concept of having a conditional probability on a distribution. Specifically:

I understand what p( A | B ) where A="I am sick" and B = "Took a flu shot" means. (probability that I am sick, given that I am from the probability of the population that took a flue shot)

But what does p( y | μ,σ²) mean?

Can an example be provided? (Just the term "y given a normal distribution" won't help me understand it - I am too stupid for that :) )

$\endgroup$
1
  • 2
    $\begingroup$ I would vote for reopening the question as asking for the difference between conditioning on an event $A$ and conditioning on a random variable $X$ sounds like a legitimate question. $\endgroup$
    – Xi'an
    Commented Oct 10, 2018 at 13:20

3 Answers 3

3
$\begingroup$

This notation has little to do with Bayesian statistics. The object $$p(y|\mu,\sigma^2)$$ is a density for the random variable $Y$ taking values $y$; the second part "|μ,σ²" means that this density (I suppose this is a probability density (pdf), but it could be a cdf as well) is indexed by two parameters $\mu$ and $\sigma^2$, as for instance in the Normal density $\text{N}(\mu,\sigma^2))$. Changing $(\mu,\sigma^2))$ modifies the density function. One could have used $$p(y;\mu,\sigma^2)\quad\text{or}\quad p_{\mu,\sigma^2}(y)$$instead. (Incidentally the bar "|" notation was introduced by Harold Jeffreys in the 30's, the same influential Bayesian Jeffreys as in Jeffreys' prior.)

When $\mu$ and $\sigma^2$ turn into random variables, as in Bayesian statistics, this becomes a conditional density of a random variable $Y$ with realisation $y$ given the random vector $(\mu,\sigma^2)$. If the concept of conditional density is new to you, you should first check an introductory probability book or just the first chapters of Casella and Berger for instance.

$\endgroup$
2
  • $\begingroup$ What does the word "indexed" mean here? Same as "defined"? $\endgroup$
    – Kirsten
    Commented Jan 7, 2021 at 16:16
  • 1
    $\begingroup$ The verb to index means labelling or identifying or parameterising. In a parametric statistical model, a family of distributions is indexed by a parameter that varies within a certain parameter set and is unknown (and to be estimated from the data). $\endgroup$
    – Xi'an
    Commented Jan 7, 2021 at 16:44
1
$\begingroup$

Since you do not write the context, but only something about normal distribution, you let the readers guess, what is exactly written in the text. Yous hould add the context.

I guess $p(y|\mu,\sigma^2)$ means a probability density of a normal distribution with mean $\mu$ and standard deviation $\sigma$. This is a function:

$$p(y|\mu,\sigma^2)= (2\pi)^{-1/2}(\sigma)^{-1} \exp(-(y-\mu)^2/(2\sigma^2))$$

$\endgroup$
1
  • 2
    $\begingroup$ Although your first paragraph is marred by apparent typographical errors, the appearance of "stupid" suggests you might be attempting to denigrate the question. We all hope that is not your intention, so please--as soon as possible--edit this post so that it won't be misread as violating our site policies for civil interaction. When you do this, please seriously consider the possibility you have not fully grasped the intent of the question. Often a question sounds "stupid" only when it is not correctly understood. $\endgroup$
    – whuber
    Commented Oct 8, 2018 at 15:29
0
$\begingroup$

Short answer:

It's really a shorthand way of writing things. If you have three distributions, $Y, \mu, \sigma^2$, $p(y|\mu, \sigma^2)$ is essentially just $p_Y(y|\mu = \mu_0, \sigma^2 = \sigma_0^2)$ (i.e. you're evaluating the density of $Y$, at the constant values of the distributions of $\mu, \sigma^2$)


Long answer:

Let's say that you've got some data $y_i$ - some i.i.d. samples from some distribution. Let's say (assume) that the distribution of these data points is a normal distribution.

The normal distribution has some parameters associated with it that change the location and scale of the normal "bell" curve. You would want to find out what those parameters are, using your data.

So, you've essentially got this model:

$$Y_i \sim N(\mu, \sigma^2)$$

In Bayesian statistics, you treat the parameters $\mu, \sigma^2$ as random variables and place some prior distribution on them. The role of data here is to narrow down your uncertainty regarding your parameters.

Here's where the posterior distribution comes in. As an example, let's pretend we know what $\sigma^2$ is, and just concentrate on $\mu$. If we let the prior distribution to be $p_{\mu}(\mu_0)$, i.e. the density of $\mu$ evaluated at constant $\mu_0$, then the posterior is usually expressed as:

$$p(\mu|y) \propto p(y|\mu) p(\mu)$$

... (as you've got it) is just a shorthand way of writing:

$$ p_{\mu}(\mu_0 | Y = y) \propto p_Y(y|\mu = \mu_0) * p_{\mu}(\mu_0) $$

$\endgroup$
6
  • $\begingroup$ I lost the understanding when you said "Here's where the posterior distribution comes in...". What allows us to say that the distribution (μ,σ2) can be treated as the "B" in p(A|B)? Can a small example be provided? Thanks!!! $\endgroup$ Commented Oct 8, 2018 at 15:32
  • $\begingroup$ I think I am starting to semi-understand what you are saying: if Y is the probability that "I am sick" and (μ,σ2) is some kind of distribution of of how many people took the flu shot...I am trying to find μ and/or σ2? Now what does a distribution of "how many people took the flu shot" (My wording) means? $\endgroup$ Commented Oct 8, 2018 at 15:41
  • 1
    $\begingroup$ With probabilities, you can condition on random variables. This means that, if X and Y are random variables, it makes sense to say $P_X(x|Y = y)$, i.e. probability of X being x given that Y was observed to be y. In your example, notice that "B" is exactly like Y; writing it out properly, we have: $$A = 1\;if\;"sick", 0\;if\;"not\;sick"$$ $$B = 1\;if\;"shot",\;0\;if\;"took\;a\;shot"$$ Then, your statement $P(sick | shot)$ is more suggestively written as: $$P("sick"|"shot") = P(A = 1 |B = 1 )$$ $\endgroup$
    – adityar
    Commented Oct 8, 2018 at 15:43
  • $\begingroup$ But in my case B= μ,σ2 ... I think that is where my confusion lies. $\endgroup$ Commented Oct 8, 2018 at 15:49
  • $\begingroup$ @SacharRosen: Can you state clearly if you are aware of the difference between a conditional probability function and a conditional density function? If not, this would explain for the confusion and indicate that some further training in probability basics is needed. $\endgroup$
    – Xi'an
    Commented Oct 10, 2018 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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