Shiny dashboard "Statistical foundations of machine learning"

Conditional independence

From marginal dependence to conditional independence

The first tab visualizes the relation between two random variables $x$ and $y$ where

$$y=az+w_y$$ and $$x=bz+w_x$$ where $w_z$ and $w_y$ are Gaussian independent noise terms. The two variables are strongly correlated (then dependent) as shown by the slope of the black line.

Once we condition on $z$ instead, we focus on the red points (satisfying the condition on $z$) only and the two variables become conditionally independent (slope close to zero).

From marginal independence to conditional dependence

The first tab visualizes the relation between two independent random variables $x$ and $y$ as shown by the horizontal black line. Let $$ z =a x +b y +w_z $$ a third random variable.

If we condition on a value of $z=\bar{z}$ (focus on red points satisfying the condition on $z$ ) we see that we create a strong correlation between $x$ and $y$ as illustrated by the red line (slope different from zero).



gbonte/gbcode documentation built on Feb. 27, 2024, 7:38 a.m.