1
$\begingroup$

This is probably a question with a simple answer, but the reason is likely to be more technical.

Suppose $Y$ and $X$ are random variables and $f$ is a function of single variable (it is not to mean probability density, neither marginal nor conditional) without any assumptions regarding the type of the function or dependence of the random variables, is there a difference between $f(Y) \vert X = x$ and $f(\{Y \vert X = x\})$?

Basically does it matter whether the conditional information is supplied before or after applying the function?

EDIT:

Due to notational confusion I am adding @Xi'an's better formulation here. Why is the probability distribution of the random variable $f(Y)$ conditional on the event $X=x$ is formally identical to the probability distribution of the random variable $f(Z)$ when $Z$ is distributed from the conditional distribution $p(y|X=x)$?

$\endgroup$
3
  • 1
    $\begingroup$ I don't think it makes sense to use notation $f(Y|X)$ for arbitrary functions, e.g. what is the meaning of $f(Y|X)=\max(X,Y)$, isn't it just a function of two variables $g(X,Y)$? Also, if it depends on two variables, the domain should include both $X$ and $Y$; then $f(Y)$ can't be the same $f$ since it only depends on $Y$, and not $X$. $\endgroup$
    – gunes
    Commented Jan 30, 2021 at 9:13
  • 1
    $\begingroup$ Xian correctly answers the idea behind the question. But there is a sidenote about the notation: The notation $f(Y) \vert X = x$ could be interpreted as a short-handed writing of $f(Y,X) \vert X = x$ in which case the function is being differently applied depending on $X$. $\endgroup$ Commented Feb 9, 2021 at 7:25
  • 1
    $\begingroup$ @Gunes in the problem here the function $f(\cdot)$ is a transformation of a single variable. To me the notation $f(Y|X)$ makes sense as rewriting the function $f(Z(X))$ with the substitution $Z(X) = Y|X$ $\endgroup$ Commented Feb 9, 2021 at 7:29

2 Answers 2

5
$\begingroup$

The conditional probability distribution of the random variable $W=f(Y)$ conditional on the event $X=x$ is identical to the conditional probability distribution of the random variable $f(Z)$ when $Z$ is distributed from the conditional distribution $p(y|X=x)$.

To wit, by the (annoyingly named) "law of the unconscious statistician" \begin{align} \mathbb P^Y(f(Y)\in A)=\mathbb P^W(W\in A) &=\mathbb E^X[\mathbb E^{W|X}\{\mathbb I_A(W)|X \}] \end{align} and \begin{align} \mathbb P^Y(f(Y)\in A) &= \mathbb E^X[\mathbb P(f(Y)\in A|X)]\\ &=\mathbb E^X[\mathbb E^{Y|X}\{\mathbb I_A(f(Y))|X \}]\\ &=\mathbb E^X[\mathbb E^{Z|X}\{\mathbb I_A(f(Z))|X \}] \end{align} where the last step is just a change of notation (see note below).

As an illustration, take $X$ to be a Poisson $\mathcal P(\lambda)$ random variable and $Y$ conditionally on $X$ to be a Binomial $\mathcal B(X,p)$ random variable (making $Y$ marginally a Poisson $\mathcal P(p\lambda)$ random variable). And take $f(y)=\mathbb I_0(Y)$. Then

  • conditional on $X=x$, $f(Y)$ is a Bernoulli random variable with probability $(1-p)^x$ as the transform by $f$ of a Binomial $\mathcal B(x,p)$ random variable
  • $W=f(Y)$ is a Bernoulli random variable with conditional distribution a Bernoulli distribution with probability$$\mathbb P(W=1|X=x)=\mathbb P(Y=0|X=x)=(1-p)^x$$

Note that the issue with the notation in the question is that $Y|X$ is not a standard notation, if one means "the random variable with distribution equal to the conditional distribution of $Y$ given $X$" because $Y|X$ does not exist as such: $Y$ has both a marginal distribution and a conditional distribution, conditional on another random variable such as $X$. In other words, generating $Y$ from its marginal or (i) generating $X$ from its marginal then (ii) $Y$ from its conditional given the realisation of $X$ produces the same random variable. (This is why I conditioned upon $X=x$ in this answer.)

$\endgroup$
1
  • $\begingroup$ The whole point is why the transition to last step holds. I don't see it. It is not a simple change of notation. $\endgroup$ Commented Jan 31, 2021 at 8:14
3
$\begingroup$

Strictly speaking, without any context about what $f(\cdot)$ denotes, I would say there is a difference from a notation standpoint.

If $Y$ is a random variable, then $f(Y)$ is also a random variable, and so the notation $f(Y)|X$ would read to me as:

"The random variable $f(Y)$ given/conditioned on the random variable $X$".

On the other hand, many could easily interpet $f(Y|X)$ as meaning:

"The density function of $Y$ conditioned on the random variable $X$"

So if $f(\cdot)$ is just a generic function, and not the density function of $Y$, you should avoid putting the condition within brackets to make this clear.

$\endgroup$
0

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.