CSDS 600-101 Special Topics: Machine Learning and Causal Inference (2023 Fall) Homework 3 Instructor: Jing Ma (jing.ma5@case.edu) TA: Cerag Oguztuzun (cerag.oguztuzun@case.edu) Due: Sat 11/18/2023 (23:59 PM EST Time) Note: The assignment must be submitted electronically on Canvas. Please submit your solution as a pdf file with name “HW3_Lastname_Firstname”. *The submissions will not be accepted after the deadline*. Problem 1 (25 Pts) Given the causal graph as follows. X represents the amount of time a student spends in an after-school remedial program, H the amount of homework a student does, and Y a student’s score on the exam. Figure 1: Causal model for Problem 1. We assume that all U factors are independent. Let us consider a student named Joe, for whom we measure X = 0.5, H = 1, and Y = 1.5. • (5 pts) Compute the values of the exogenous U variables for Joe. • (5 pts) Suppose we want to know this counterfactual: "What would Joe’s score have been had he doubled his homework". Then in the Abduction-Action-Prediction process, what 1 would be the modified causal model? Please draw this causal graph and write the modified structural equation. • (5 pts) Compute the above counterfactual of Joe’s score had he doubled his homework. • (5 pts) Compute the counterfactual of Joe’s score had he doubled his amount of time in after-school remedial program. • (5 pts) Suppose X is a sensitive feature, in order to achieve counterfactual fairness, what variables should you include to predict Y ? List them and explain. 2 Answer: 3 Problem 2 (20 Pts) Please read the following material: (Counterfactuals in Linear Models) In nonparametric models, counterfactual quantities of the form E[YX←x|Z = e] may not be identifiable, even if we have the luxury of running experiments. In fully linear models, however, things are much easier. Theory: Let τ be the slope of the total effect of X on Y , τ = E[Y |do(x + 1)] − E[Y |do(x)], then, for any evidence Z = e, we have E[YX←x|Z = e] = E[Y |Z = e] + τ(x − E[X|Z = e]). This provides an intuitive interpretation of counterfactuals in linear models: E[YX←x|Z = e] can be computed by first calculating the best estimate of Y conditioned on the evidence e, E[Y |e], and then adding to it whatever change is expected in Y when X is shifted from its current best estimate, E[X|Z = e], to its hypothetical value, x. • (5 pts) Describe how the parameters a, b, c in Figure 1 can be estimated from observational data. • (5 pts) For the causal model in Figure 1, calculate τ. • (5 pts) For the causal model in Figure 1, compute the "effect of treatment on the treated group (ETT)": E[YX←1 − YX←0|X = 1]. How is it compared with τ? • (5 pts) In the following linear model in Figure 2, find the causal effect of college on those students whose salary is Y = 1. [Hint: that is E[YX←1 − YX←0|Y = 1].] Figure 2: Causal model 2. 4 Answer: 5 Problem 3 (25 Pts) Please read the following material about direct and indirect causal effects: A typical mediation problem takes the form: T = fT (uT ), M = fM(T,uM), Y = fY (T,M,uY ), where T is treatment, M is mediator, and Y is outcome, fT , fM, and fY are arbitrary structural functions, and UT , UM, UY represent exogenous variables. Four types of effects can be defined for the transition from T = 0 to T = 1. (A) Total effect. TE = E[Y1 − Y0] = E[Y |do(T = 1)] − E[Y |do(T = 0)] TE measures the expected increase in Y as the treatment changes from T = 0 to T = 1, while the mediator is allowed to track the change in T naturally, as dictated by the function fM. (Here, the potential outcome Yt is actually short for YT←t) (B) Controlled direct effect. CDE(m) = E[Y1,m − Y0,m] = E[Y |do(T = 1,M = m)] − E[Y |do(T = 0,M = m)]. CDE measures the expected increase in Y as the treatment changes from T = 0 to T = 1, while the mediator is set to a specified level M = m uniformly over the entire population. (C) Natural direct effect. NDE = E[Y1,M0 − Y0,M0]. NDE measures the expected increase in Y as the treatment changes from T = 0 to T = 1, while the mediator is set to whatever value it would have attained (for each individual) prior to the change, that is, under T = 0. (D) Natural indirect effect. NIE = E[Y0,M1 − Y0,M0]. NIE measures the expected increase in Y when the treatment is held constant, at T = 0, and M changes to whatever value it would have attained (for each individual) under T = 1. It captures, therefore, the portion of the effect that can be explained by mediation alone, while disabling the capacity of Y to respond to X. In linear systems, we have TE = NDE + NIE. • (10 pts) Consider the linear structural model: use the above definition, compute TE, NDE, and NIE. • (5 pts) Repeat problem 3.1 assuming that uy is correlated with um. 6 • (10 pts) Consider the non-linear structural model: use the above definition, compute TE, NDE, and NIE. Do we still have TE = NDE + NIE? 7 Answer: 8 Problem 4 (30 Pts) This is a coding task. See the attached .ipynb file. Answer: .ipynb file is submitted via Canvas. 9