# Expectation of structural equation

I am trying to learn about structural equations, and in this post here Correlation, regression and causal modeling I am having difficulties trying to prove the answer.

The problem is, given structural equations $$U=\epsilon_u$$ $$X=\delta U +\epsilon_x$$ $$Y=\beta X+\gamma U+\epsilon_y$$

Where all terms denoted by ϵ are mean zero and mutually independent and U, X and Y have been standardized (mean zero and unit variance). Suppose U is unobserved, then if we observe X=x: $$E[Y|X=x]=(\beta +\gamma \delta )x \:\:\:\:\:\:\:equation 1$$ If we set X=x, then: $$E[Y|X=x]=\beta x\:\:\:\:\:\:\:equation 2$$

How can I prove equation 1 and equation 2? I'm stuck at equation 1 because if U is unobserved, how do you do the expectation?

• The answer was missing the detail that the errors are gaussian. See answer below for derivation. – Carlos Cinelli Mar 13 at 1:15

Edit: Carlos Cinelli's answer is the right one.

In this part we don't need to worry about unobservancy. We know DGP, so we know everything. We calculate expectations, as for standard probability calculus random variables.

In the first situation we can calculate $$U$$ as a function of X:

$$U = \frac{(X - \epsilon_x)}{\delta}$$

So then when we derive $$Y$$, it would be:

$$Y = \beta X + \frac{\gamma}{\delta}(X - \epsilon_x) + \epsilon_y$$

and after some simplification:

$$Y = (\beta + \frac{\gamma}{\delta})X - \frac{\gamma}{\delta} \epsilon_x + \epsilon_y$$

When we take expectation, we use assumption, that every $$\epsilon$$ has expectation zero and $$X$$ is equal to x. Then:

$$\mathbb E(Y|X=x) = (\beta + \frac{\gamma}{\delta})x$$

(So we can see, that the author of mentioned post made a mistake.)

The problem, that $$U$$ is not observed only has the consequences, that we can not calculate $$\mathbb E(Y|X=x, U=u)$$ using observed data. We would wish to do so in order to statistically estimate parameter $$\beta$$ instead of calculating observable $$E(Y|X=x)$$, which gives us some different value.

In second situation it is much easier, however when we set value of X, we change DGP, because we performed an experiment (which is denoted as $$do(X=x)$$):

• $$U=\epsilon_u$$
• $$X=x$$
• $$Y=\beta X+\gamma U+\epsilon_y$$

In this situation we just substitute for $$X$$ and $$U$$:

$$Y=\beta x+\gamma \epsilon_u+\epsilon_y$$

And calculate the expectation:

$$\mathbb E(Y|do(X=x)) = \beta x$$

In this situation we do not care about unobserved $$U$$, because we achieve desired effect, when we estimate this expectation with only $$x$$.

• Yes, I think the author made a mistake as well, thanks for your answer! In the second situation where do(X=x), the reason why the gamma and the error terms drop is because their expectation is zero too right? – woowz Mar 10 at 18:18
• Exactly. The only difference between the "normal" expectation and those containing the do-operator is, that the DGP is different. When you perform experiment, you remove all causal links to the variable, and replace it with manually chosen value (x). Then calculation of the expectation works exactly the same way as usual, so assumption of zero mean of those random variables zeroes them. Btw, great careful question, helped me to clarify some things too :) – cure Mar 10 at 19:37
• Hi Cure, unfortunately, your derivation is not correct. Se my answer below. – Carlos Cinelli Mar 13 at 1:10
• Cure can you explain at which point your method is incorrect? I dont see how it cant be wrong – woowz Mar 14 at 0:10
• $\epsilon_x$ is not independent on $x$. Then when we take expectation, this part should stay $E(\epsilon_x|X=x)$ and be calculated from distribution, or assuming gaussian, from formula in Carlos Cinelli's answer. Rookie mistake. Also, there is this unintuitive part of variable standarisation, where in cited answer parameters do not describe "true" causal effect, but something else, closely connected, but not the same. This deceived me, that my answer is close to empirical results. – cure Mar 14 at 3:12

The formula of the conditional expectation of a bivariate gaussian is:

$$E[Y\mid X=x] = E[Y] + \frac{Cov(Y,X)}{Var(X)}(x-E[X])\\$$

Since the variables are standardized, we have that $$E[Y] = E[X] = 0$$ and that $$Var(X) =1$$.

And $$Cov(Y, X) = \beta Var(X) + \gamma Cov(X, U) = \beta + \gamma\delta$$. Thus,

$$E[Y|X=x]=(\beta +\gamma \delta )x$$

• Hello Carlos! Thank you for the attention! I admire all your SE answers (and other materials), which helped me soo much to jump on the causality train. Regarding this question, I need to take a while and think about it. I think I am somewhere wrong, but regarding your answer I would ask about assumption that $Var(X) = 1$. I guess you ment, that $\epsilon$'s variances are standarised, so wouldn't it be that $Var(X) = \delta^2 + 1$? – cure Mar 13 at 12:17
• Ok, I think I get it. The standarisation here is tricky (and kind of deceiving) part, but I have to agree, that when you say, that such DGP is already effect of standarisation of $U$, $X$ and $Y$, then your calculation is the right one. Thanks for clarification! – cure Mar 13 at 13:23
• As for the error in cure’s answer, note that $E(\epsilon_x \mid X=x) \neq 0$. – Carlos Cinelli Mar 14 at 1:37