4
$\begingroup$

Suppose X, Y, Z are three jointly Gaussian random variables and X and Z are independent given Y. For example, take three r.v. from a OU process. Here is some R code:

nr <- 3
gg <- seq(0, 1, length.out=nr)
C <- exp(-.1*as.matrix(dist(gg)))

The precision matrix has a zero at element 1,3 and 3,1: so the first (X) and third (Z) random variables are conditionally independent given the second (Y):

P <- solve(C) # 1 and 3 are conditionally independent given 2

Now it would seem to me that these equalities hold by the rules of probability and conditioning: $$ \frac{P(X < x , Y < y)}{P(Y < y)} = P(X < x | Y < y) = P(X < x | Y < y, Z < z) = \frac{P(X < x, Y < y, Z < z)}{P(Y < y, Z < z)} $$ because events related to Z should not change our probability assessments of events related to X, due to conditional independence on Y. However, here for example I get drastically different results:

evalx <- c(-1, 1, -1)
# define a cdf for simplicity
Pr <- \(index) mvtnorm::pmvnorm(upper=evalx[ index ], sigma = C[ index, index ])

x <- 1
y <- 2
z <- 3
xy <- 1:2
yz <- 2:3
xyz <- 1:3

Pr(xy) / Pr(y) # P(X < x | Y < y): 0.186655 
Pr(xyz) / Pr(yz) # P(X < x | Y < y, Z < z): 0.3238458

Where am I making a mistake?

$\endgroup$

2 Answers 2

1
$\begingroup$

That is really perplexing, but i think i have your answer:

The problem is that $Y < y$ does not uniquely identify $Y$ and so the conditional random variable $Y|Y<y$ is not independent from the event $Z < z$, allowing it to still influence $X|Y<y$. So while $ P(X < x|Y = y) = P(X < x|Y = y, Z < z)$:$$ P(X < x|Y < y) \neq P(X < x|Y < y, Z < z) $$

I was not entirely sure, what you wanted to do in your calculation and whether you did it right, so i made a simple simulation which allowed me to plot the very different distributions of $Y|Y<y$ and $Y|Y<y, Z<z$:

enter image description here

R-Code

library(mvtnorm)
nr <- 3
gg <- seq(0, 1, length.out=nr)
C <- exp(-.1*as.matrix(dist(gg)))
solve(C)

n <- 10^5
dat <- data.frame(rmvnorm(n, sigma = C))
colnames(dat) <- c("X", "Y", "Z")
x <- -1
y <- 1
sum((dat$X < x) * (dat$Y < y))/sum(dat$Y < y) # ~0.19
z <- -1
sum((dat$X < x) * (dat$Y < y) * (dat$Z < z))/sum((dat$Y< y) * (dat$Z< z)) # ~0.73, different from yours?

hist(dat$Y[dat$Y< y], breaks = 30, col = rgb(1,0, 0, .5), freq = F, ylim = c(0, 0.85))
hist(dat$Y[as.logical((dat$Y< y) * (dat$Z < z))], breaks = 30, col = rgb(0,0, 1, .5), freq = F, add = T)
legend("topleft", legend = c("Y|Y < 1", "Y|Y < 1, Z < -1"), fill = c( rgb(1,0, 0, .5),  rgb(0,0, 1, .5)))
$\endgroup$
5
  • $\begingroup$ I still don't get it. Two random variables X and Y are conditionally independent given Z if the sigma algebras $\sigma(X)$ and $\sigma(Y)$ are conditionally independent given $\sigma(Z)$. Interval events belong to the borel sigma algebras in these cases, so in my head I still get crickets when I look at this. $\endgroup$ Commented Aug 2, 2023 at 15:27
  • $\begingroup$ You switched $Y, Z$, but it doesn't matter. By definition $\Omega$, e.g. $\{Z\in\mathbb{R}\}$, is also in $\sigma (Z)$ and conditioning on that clearly does not change anything. So being an element of the sigma-algebra is insufficient to create independence. $\endgroup$ Commented Aug 2, 2023 at 16:19
  • $\begingroup$ Ok (and sorry about the switcharoo with the names!), I get that to retain independence we'd have to condition on the whole sigma algebra and not just on an element of it. now the next thing I don't understand is how this relates to e.g. sparse graphical models. how is it that the density factorizes according to the graphical model, but the distribution doesn't? and this goes back to the usual lack of precision when learning about pmf vs "distribution function"/cdf vs pdf $\endgroup$ Commented Aug 2, 2023 at 16:26
  • $\begingroup$ I don't know what a sparse graphical model, so i sadly can't help you with that. $\endgroup$ Commented Aug 2, 2023 at 16:36
  • $\begingroup$ In this example the graphical model is $X \to Y \to Z$ and the joint density factorizes accordingly: $f(x,y,z) = f(x) f(y|x) f(z|x)$. the cdf should also factorize, but apparently not with the interval conditioning. which I find somewhat counterintuitive. I guess it's not completely counterintuitive because conditioning on $\{ Y=y \}$ is a lot stronger than a more vague statement such as $\{ Y<y \}$. $\endgroup$ Commented Aug 2, 2023 at 16:42
1
$\begingroup$

I figured a way that makes it clear that the CDF just does not factorize like a pmf/pdf and that shows that the intuition in the original question is wrong.

Suppose $X \to Y \to Z$, therefore $X\perp Z \mid Y$. Assume for simplicity and without loss of generality that $Y \in \{ y_1, y_2, y_3 \}$. \begin{align*} &P(X\le x, Y \in \{y_1, y_2\}, Z\le z) \\&= P(Y = y_1) P(X\le x, Z\le z \mid Y = y_1) + P(Y = y_2) P(X\le x, Z\le z \mid Y = y_2)\\ &= P(Y = y_1) P(X\le x \mid Y = y_1)P( Z\le z \mid Y = y_1)\\ & \qquad + P(Y = y_2) P(X\le x \mid Y = y_2)P( Z\le z \mid Y = y_2)\\ &\ne P(Y \in \{y_1, y_2 \}) P(X\le x \mid Y \in \{y_1, y_2\}) P(Z\le z\mid Y \in \{y_1, y_2\}) \end{align*} Where I used the law of total probability in the first equality and then conditional independence in the second equality. The last inequality is what I was really wishing was true.

The intuition is similar to @lukas-lohse's answer: conditioning on the event $Y \in \{ y_1, y_2 \}$ isn't "really conditioning" in the sense that we still don't know what value $Y$ takes and so we need to use total probability and take the average probability for all possible values $Y$ can take.

I think another correct way to state this is that for all $y$, we have that $\sigma(X \mid Y=y) \perp \sigma(Z \mid Y=y)$ which again checks out the sigma algebras argument but relates it to the two random variables $X \mid Y=y$ and $Z \mid Y=y$.

A lot of sources mention how the "probability distribution" factorizes according to the graphical model but I guess that's very imprecise terminology since typically we refer to the cdf as the "probability distribution" and again, the cdf does not factorize. It is the pdf/pmf that factorizes.

Also, I found this https://epub.ub.uni-muenchen.de/1550/1/paper_161.pdf but it seems the stuff at the end of page 4 is wrong for the same reasons

$\endgroup$

Your Answer

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