Foundations to Frontier
Tests
A. Mathematical Foundations › A5 Statistics › Causal inference

Instrumental Variables and Propensity Scores

When you can't randomize, two strategies rescue causal estimates from observational data. If every confounder is measured, the propensity score (the probability of treatment given covariates) lets you weight or match so the groups look randomized; doubly robust estimators add a safety net. If a confounder is hidden but something randomly nudges the treatment without touching the outcome otherwise (an instrument), IV estimation isolates the causal part. You will learn both, their assumptions (overlap, exclusion, relevance, monotonicity), and their failure modes.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Two ways to make a fair comparison afterwards

Propensity scores. Older robots were more likely to get a maintenance patch. To compare fairly, give each robot a weight. An old robot that didn’t get the patch is rare, so it counts extra. Then the patched and unpatched groups have the same age mix, as if a coin had decided.

Instruments. Sometimes the reason for treatment is hidden. Suppose a random factor, like a firmware gain chosen by lottery, pushed some wheels to spin faster and has no other effect on slip. Comparing outcomes across that random push reveals the causal effect of speed, even with hidden confounders.

Causal effects without an experiment: propensity weighting and instruments
treatedcontrolspropensity e(x) → 1
true ATE 2.00 · naive 5.11 · IPW 1.72 · effective sample size 921 of 2000
Units with high x are both more likely to be treated and have higher outcomes, so the naive difference is inflated. Weighting each unit by 1/P(its treatment | x) rebuilds a pseudo-population where treatment is independent of x. As k grows, the histograms separate (poor overlap): a few units get huge weights, the effective sample size collapses, and IPW becomes noisy. Positivity is failing.
Why engineers care

Fleet logs, flight data and maintenance records are observational. Propensity methods and instruments are the standard tools for estimating “what would this change do?” from such data. Their assumptions tell you which sensors and records you must keep.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A propensity score is…
  2. 2. An instrument affects the outcome…
  3. 3. Instruments are useful when confounders are…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The propensity score (Rosenbaum and Rubin, 1983)

e(x)=P(T=1∣X=x)e(x) = P(T = 1\mid X = x). If treatment is ignorable given XX, it’s ignorable given e(X)e(X) alone. This is the balancing property: among units with the same ee, covariates have the same distribution in both arms. That reduces many covariates to one number for matching, stratification or weighting.

Inverse-propensity weighting (IPW):

ATE^=1n∑i[TiYie(Xi)−(1−Ti)Yi1−e(Xi)]\widehat{\text{ATE}} = \frac1n\sum_i\Big[\frac{T_iY_i}{e(X_i)} - \frac{(1 - T_i)Y_i}{1 - e(X_i)}\Big]

A treated unit with e=0.2e = 0.2 stands in for 5 units. Normalizing the weights in each arm (Hájek) is more stable.

Instrumental variables

ZZ is an instrument for X→YX\to Y if it is

  1. relevant: it affects XX;
  2. excluded: it affects YY only through XX;
  3. independent: it is unconfounded with YY. It’s often randomized.

With one instrument and a linear effect, β=Cov⁡(Y,Z)/Cov⁡(X,Z)\beta = \operatorname{Cov}(Y, Z)/\operatorname{Cov}(X, Z) (the Wald estimator).

📝 Quick check (Level 1)
0/3 answered
  1. 1. The balancing property says, given e(X), covariates are…
  2. 2. IPW weight for a control unit with e = 0.9?
  3. 3. The IV (Wald) estimate is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

Doing propensity analysis well

  • Estimate e(x)e(x) with logistic regression or ML (boosting, forests). The goal is balance, not prediction accuracy.
  • Check overlap: plot the ee histograms by arm. Trim units with e<0.05e<0.05 or e>0.95e>0.95, or target the overlap population.
  • Check balance: standardized mean differences after weighting should satisfy ∣SMD∣<0.1|\text{SMD}| < 0.1.
  • Watch the effective sample size (∑w)2/∑w2(\sum w)^2/\sum w^2.
  • Doubly robust (AIPW) combines an outcome model μt(x)\mu_t(x) with the propensity:
τ^DR=1n∑i[μ1−μ0+Ti(Yi−μ1)e−(1−Ti)(Yi−μ0)1−e]\hat\tau_{\text{DR}} = \frac1n\sum_i\Big[\mu_1 - \mu_0 + \frac{T_i(Y_i - \mu_1)}{e} - \frac{(1 - T_i)(Y_i - \mu_0)}{1 - e}\Big]

It’s consistent if either model is correct, and efficient if both are (Robins, Rotnitzky and Zhao, 1994). With cross-fitting and ML nuisance models it becomes double/debiased ML (Chernozhukov et al., 2018).

Doing IV well

  • Two-stage least squares (2SLS): regress XX on ZZ, then YY on the fitted X^\hat X. Use the correct IV standard errors.
  • Weak instruments: a first-stage F below about 10 means bias toward OLS and unreliable intervals (Staiger and Stock, 1997).
  • The exclusion restriction can’t be tested from data alone. It needs domain arguments.
🐍 Exercise 1: propensity weighting and double robustness
Fit a logistic propensity model to confounded maintenance logs. Compare naive, outcome-regression (deliberately misspecified), IPW and AIPW estimates of the ATE.
📝 Quick check (Level 2)
0/3 answered
  1. 1. AIPW is consistent if…
  2. 2. A first-stage F of 3 suggests…
  3. 3. The exclusion restriction is…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Why IPW is unbiased

E[TYe(X)]=E[E[T∣X] E[Y(1)∣X]e(X)]=E[Y(1)]\mathbb E\big[\frac{TY}{e(X)}\big] = \mathbb E\big[\frac{\mathbb E[T\mid X]\,\mathbb E[Y(1)\mid X]}{e(X)}\big] = \mathbb E[Y(1)]. This uses consistency (TY=TY(1)TY = TY(1)), ignorability (T⊥Y(1)∣XT\perp Y(1)\mid X), and positivity (e>0e > 0). ∎ This is importance sampling (A5.2-6) from the treated distribution to the population.

The Wald estimator

With Y=βX+UY = \beta X + U and Z⊥UZ\perp U: Cov⁡(Y,Z)=βCov⁡(X,Z)+Cov⁡(U,Z)=βCov⁡(X,Z)\operatorname{Cov}(Y, Z) = \beta\operatorname{Cov}(X, Z) + \operatorname{Cov}(U, Z) = \beta\operatorname{Cov}(X, Z). ∎ OLS fails because Cov⁡(X,U)≠0\operatorname{Cov}(X, U)\ne0.

LATE: what IV estimates with heterogeneous effects

Take a binary instrument and binary treatment, under monotonicity (no one takes the treatment because they weren’t encouraged). The Wald ratio

E[Y∣Z=1]−E[Y∣Z=0]E[X∣Z=1]−E[X∣Z=0]\frac{\mathbb E[Y\mid Z{=}1] - \mathbb E[Y\mid Z{=}0]}{\mathbb E[X\mid Z{=}1] - \mathbb E[X\mid Z{=}0]}

equals the local average treatment effect among compliers, the units whose treatment the instrument changes (Imbens and Angrist, 1994). It’s not the population ATE.

Exercise 3.1: Encouragement design

A random half of operators is encouraged to enable a new mode (Z = 1). Uptake is 70% if encouraged and 10% if not. Success is 62% vs 50%. LATE =0.12/0.60=0.20= 0.12/0.60 = 0.20 among compliers.

📝 Quick check (Level 3)
0/3 answered
  1. 1. IPW is a form of…
  2. 2. With heterogeneous effects, IV identifies…
  3. 3. Monotonicity rules out…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Effect of wheel speed on slip, with hidden soil cohesion

Soil cohesion (unobserved) makes wheels spin faster and slip less, so OLS gets the effect of speed on slip badly wrong. Engineers randomized a torque-gain parameter across traverses. It changes wheel speed and affects slip only through speed. IV with that gain as the instrument recovers the true effect. With a weak gain (small Z → X effect), the IV estimates become extremely variable.

🐍 Exercise 2 (research): IV for wheel slip
Simulate a hidden confounder, a randomized instrument and a linear effect. Compare OLS, the Wald ratio and 2SLS, then show how a weak instrument inflates the spread of IV estimates.

These tools in AI, robotics and aerospace

  • Off-policy evaluation: importance-weighted and doubly robust estimators of a new policy’s value from logs (Dudík, Langford and Li, 2011; Jiang and Li, 2016).
  • Double ML for treatment effects with high-dimensional confounders, such as sensor histories (Chernozhukov et al., 2018).
  • IV in learning and control: IV methods for system identification under correlated noise (Söderström and Stoica, 1983), and deep IV for counterfactual prediction (Hartford et al., 2017).
  • Covariate-shift correction: importance weighting by density ratios between training and deployment data (Shimodaira, 2000), the same mathematics as IPW.

References

  1. P. Rosenbaum, D. Rubin (1983). “The central role of the propensity score in observational studies for causal effects.” Biometrika, 70(1).
  2. J. Robins, A. Rotnitzky, L. P. Zhao (1994). “Estimation of regression coefficients when some regressors are not always observed.” JASA, 89(427).
  3. V. Chernozhukov et al. (2018). “Double/debiased machine learning for treatment and structural parameters.” Econometrics Journal, 21(1).
  4. G. Imbens, J. Angrist (1994). “Identification and estimation of local average treatment effects.” Econometrica, 62(2).
  5. J. Angrist, G. Imbens, D. Rubin (1996). “Identification of causal effects using instrumental variables.” JASA, 91(434).
  6. D. Staiger, J. Stock (1997). “Instrumental variables regression with weak instruments.” Econometrica, 65(3).
  7. P. Austin (2011). “An introduction to propensity score methods for reducing the effects of confounding in observational studies.” Multivariate Behavioral Research, 46(3).
  8. N. Jiang, L. Li (2016). “Doubly robust off-policy value evaluation for reinforcement learning.” ICML.
  9. J. Hartford, G. Lewis, K. Leyton-Brown, M. Taddy (2017). “Deep IV: a flexible approach for counterfactual prediction.” ICML.
  10. T. Söderström, P. Stoica (1983). Instrumental Variable Methods for System Identification. Springer.