5
$\begingroup$

I know that:

$P(X=x|Y=y)=\frac{P(X=x,Y=y)}{P(Y=y)}$

But I'd like to understand what $X=x|Y=y$ means by itself, for example $(X=x,Y=y)$ means $X=x$ and $Y=y$. Would $X=x|Y=y$ mean? that $X=x$ when $Y=y$?

A example to make it easier (take these as observations):

$X=\{1,6,7,8\}$

$Y=\{0,1,19,5\}$

$(X=x|Y=y) = ?$

$\endgroup$
11
  • 3
    $\begingroup$ Some people will say that "$X=x\mid Y=y$" is not an event, at least not in the original probability space, so it is not meaningful $\endgroup$
    – Henry
    Oct 3, 2021 at 8:49
  • $\begingroup$ Read "$|$" as "given". Your example probably won't be helpful to you until you specify what $y$ is. $\endgroup$
    – Glen_b
    Oct 3, 2021 at 8:55
  • 1
    $\begingroup$ Your example has a probability space of $(\Omega, \mathcal F, \mathbb P)$ where $\mathcal F$ has $2^{16}$ events for which you can find the probability: one of these is $X=1$, another is $Y=0$, while a third is $X=1$ and $Y=0$. But $X=1 \mid Y =0$ is not one of them, and you can construct an example where your $P(X=1 \mid Y=0)$ is not any of the probabilities of any event. When you condition on $Y=0$, you have two choices, both of which change the space: (a) you can restrict $\Omega$ to only include cases where $Y=0$, changing $\mathcal F$ and $\mathbb P$, or (b) only change $\mathbb P$.... $\endgroup$
    – Henry
    Oct 3, 2021 at 10:04
  • 1
    $\begingroup$ ... Once you have made that change, it does not matter whether you say "$X=1 \mid Y=0$" means the event "$X=1$ and $Y=0$" or say it is the event "$X=1$" in the new probability space. Both will lead to the same probability in the conditional probability space, while neither will necessarily give the correct answer in the original probability space. This means "$X=1 \mid Y=0$" is not an event in the original probability space $\endgroup$
    – Henry
    Oct 3, 2021 at 10:11
  • 2
    $\begingroup$ The "|" symbol is part of the "P" syntax -- X=x|Y=y doesn't mean anything by itself $\endgroup$
    – jwimberley
    Oct 3, 2021 at 10:20

3 Answers 3

6
$\begingroup$

Example: Say you have a group of men and women and know their handedness (left/right). It is like depicted in the table below $$\begin{array}{r|c|c | c} &\text{men}&\text{women} &\text{total}\\ \hline \text{left handed}&9&4&13\\\hline \text{right handed}&43&44&87\\\hline \text{total}&52&48&100 \end{array}$$

Say you pick randomly a person out of this group then it is $13\%$ probability that they are left handed. But if you know that the person is a woman, then the probability is $4/48 \approx 9 \%$.

To express this latter case, the probability of an event, given another event or condition, one uses the vertical bar symbol $\vert$.

$$P(X\vert Y) = \text{probability of event $X$ given/conditional on event $Y$}$$

So it is about both events $X$ and $Y$ happening. But, this is different from $P(X,Y)$, the probability that both $X$ and $Y$ are happening.

The probability for left handedness given that a person is a woman, is not equal to $4 \%$ the probability that someone is a woman and left handed.


The expression $X\vert Y$ occurs within the probability operator $P()$. But you should not read all the contents as a single event.

  • So this is not how you must interpret it: "$P(\dots)$ is probability of the event on the dots. So $P(X\vert Y)$ is the probability of the event $X\vert Y$." This $X\vert Y$ is not an event (as Henry noted in the comments). The vertical bar $\vert$ adds additional parameters to the probability operator and refers to conditions.
$\endgroup$
7
$\begingroup$

The $|$ symbol in probability theory stands for “given”. You would most commonly see it used for conditional probability $P(Y|X)$, the probability of $X$ given $Y$. While it’s a slight abuse of notation, you could see something like

$$ Y|X \sim \mathcal{N}(\mu, \sigma) $$

for $Y$ conditionally on $X$ following normal distribution. You would also see it to show some properties of distributions, like conditional expectations $E[Y|X]$, or variance $\operatorname{Var}(Y|X)$, etc.

Notice that something like $X|Y$ alone doesn’t make much sense. What would it be? “A random variable conditional on another random variable”? Conditioning is about the perspective you take when looking at the variable, not a property of the variable. You can “transform” conditional probability to joint, or marginal, or reverse it (Bayes theorem) with just simple mathematical manipulations on the distributions.

$\endgroup$
1
  • $\begingroup$ (+1) Unfortunately not many elementary textbooks explicitly states the conditional to a distribution such as $Y|X \sim \mathcal{N}(\mu, \sigma)$ and treat conditional probabilities as an elusive concept. $\endgroup$ Oct 4, 2021 at 7:42
4
$\begingroup$

This can get quite philosophical fast. But, Judea Pearl's book Causal Inference for Statistics Section 1.3.3 provides a nice intuition, the operator $|$ implies a filtering of the data in the frequentist interpretation. An intuitive example would be two variables having bounds $P(X>a|Y<b)$, so conditioning implies filtering the data, i.e., removing parts of the data where condition $Y<b$ doesn't hold first.

Regarding if $X|Y$ is an event or not. It isn't an event in plain form but the resulting filtering operation leads to an event. Philosophical part of this then, what would be the Bayesian interpretation and even conditional probability can exist in isolation.

$\endgroup$
1
  • $\begingroup$ I've thought it before. $\endgroup$ Oct 3, 2021 at 22:04

Your Answer

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

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