Causal Forests with Fixed Effects (CFFE)
- Causal Forests with Fixed Effects (CFFE) are advanced nonparametric estimators that isolate true treatment heterogeneity by locally residualizing unit and time fixed effects in panel data.
- They overcome biases common in standard causal forests by addressing spurious heterogeneity and inadequacies in global demeaning, leading to improved CATE, ATE, and GATE estimates.
- Both frequentist and Bayesian implementations have demonstrated robust performance through simulations and empirical studies, ensuring scalable inference in complex panel environments.
Causal Forests with Fixed Effects (CFFE) are advanced nonparametric estimators designed for heterogeneous treatment effect inference in panel data with unit and time fixed effects. Conventional causal forest algorithms assume independent and identically distributed observations and do not adequately address bias introduced by systematic unit and time effects. The CFFE methodology orthogonalizes fixed effects locally during tree-building, thereby isolating genuine treatment heterogeneity and overcoming confounding from spurious sources. Key implementations include node-level residualization in frequentist forests (Aytug, 15 Jan 2026) and the Parallel Trends Assumption (PTA)–based Bayesian Causal Forests in the DiD-BCF model (Souto et al., 14 May 2025). Simulation and empirical results confirm that CFFE yields accurate Conditional Average Treatment Effect (CATE), Group Average Treatment Effect (GATE), and Average Treatment Effect (ATE) estimates in rich panel settings.
1. Panel Data Model with Fixed Effects
CFFE algorithms operate on balanced panel data comprising units across time periods. Observed outcomes are , treatment indicators , and covariates . The canonical two-way fixed effects model is: where denotes unit-level fixed effects, represents time-level shocks, is the CATE function, and is a mean-zero error. Identification requires conditional parallel trends, overlap ( for some ), and SUTVA (no spillovers).
In the PTA-based Bayesian Causal Forest framework, the model is reparameterized: with absorbing baseline variation including fixed effects and active only post-treatment.
2. Limitations of Standard Causal Forests in Panel Settings
Traditional causal forests maximize local heterogeneity via greedy covariate splits under the assumption of i.i.d. observations. In panel contexts, fixed effects induce two principal distortions:
- Spurious heterogeneity: Covariate splits that inadvertently segment units or periods with differing or produce inflated estimates of treatment effect variation, confounding true CATE heterogeneity.
- Residualization inadequacy: Applying global sample-wide demeaning for fixed effect correction fails to account for the compositional changes within tree nodes, leaving local bias unaddressed.
These issues result in inconsistent treatment effect estimation particularly when fixed effects are correlated with covariates. Standard causal forest estimators such as EconML’s CausalForestDML exhibit substantial bias and inflated RMSE in such panel environments (Aytug, 15 Jan 2026).
3. Node-Level Fixed Effect Residualization
CFFE employs localized fixed effect residualization during recursive partitioning. For each tree node , the subset-specific two-way FE model is fit:
where are node-level estimates, iteratively obtained via alternating unit and time demeaning until convergence. This orthogonalization ensures that subsequent splitting and estimation target genuine between-node heterogeneity in .
In Bayesian causal forest constructions, the reparameterization via PTA additionally prevents contamination from pre-treatment periods by restricting treatment-effect tree growth exclusively to post-treatment observations (Souto et al., 14 May 2025).
4. Splitting and Estimation Procedures
Frequentist CFFE
Splitting in CFFE trees is governed by local residuals. For a proposed split partitioning into and :
- Estimate local treatment effects:
- Define split quality: The optimal split maximizes , balancing heterogeneity enhancement and node size regularity.
Tree growth incorporates cluster-aware subsampling (sampling units and all their observations), honest splitting (random structure/estimation splits), recursive node construction, and leaf-wise estimation via re-residualized data.
Bayesian DiD-BCF
The Bayesian approach deploys two forests: a prognostic (baseline) forest for and a treatment effect forest for . Each uses tree-structure priors (with depth-dependent split probabilities), leaf-parameter priors (Half-Cauchy or Gaussian), and an error-variance inverse- prior. Fitting leverages Gibbs sampling with optional warm-start initialization, alternating updates for the and forests based on residuals, and explicit FE sampling if desired (Souto et al., 14 May 2025). Posterior draws enable direct inference for CATE, ATE, and GATE.
5. Statistical Properties and Inferential Procedures
CFFE acheives consistency and asymptotic normality under regularity as . Specifically,
Variance is estimated via half-forest Jackknife: forests are split, yielding two independent estimates , with
Confidence intervals take the form ; coverage degrades modestly in finite samples (Aytug, 15 Jan 2026).
CATE, ATE, and GATE are derived directly via estimators. For DiD-BCF, GATEs can be computed for pre-specified groups (e.g., event-time or cohort membership).
6. Implementation and Practical Considerations
Python (causalfe):
- Core class:
CFFEForest, supporting cluster subsampling, honest splitting, node-specific FE residualization, split optimization, and tree aggregation. - Fitting:
fit(X, Y, D, unit_ids, time_ids). - Prediction:
predict(X_new)andpredict_interval(X_new, alpha)for confidence intervals. - Follows scikit-learn API conventions (Aytug, 15 Jan 2026).
Bayesian approaches:
- R packages:
bcf,XBCF(for warm-start), as well as custom Stan/PyMC implementations. - Python: adaptation of
bartpyor custom BART code (Souto et al., 14 May 2025). - Warm-start via XBART reduces MCMC burn-in substantially.
Hyperparameter settings (number of trees, split probabilities ) are robust to defaults, but further shrinkage or deeper splits may be necessary to avoid overfitting. Computational demands are nontrivial for large panels ().
7. Simulation Results and Empirical Applications
Simulation studies (e.g., , , 100 replications) validate CFFE performance on placebo (), homogeneous (), heterogeneous (), and fixed effect–correlated DGPs:
- Placebo: mean , RMSE , coverage .
- Homogeneous: mean (true = 2), RMSE .
- Heterogeneous: RMSE , corr.
- CFFE exhibits lower RMSE than non-FE forests when correlated with (Aytug, 15 Jan 2026).
DiD-BCF simulations (linear, nonlinear, staggered adoption, selection, CHTE) confirm lowest RMSE/MAE/MAPE on ATE/GATE/CATE versus alternatives (TWFE, DiD-DR, two-stage DiD, Synthetic DiD, DoubleML) (Souto et al., 14 May 2025).
An applied study on US minimum wage policy finds that DiD-BCF reveals stronger negative employment effects in small counties (ATE ) than are detectable with parametric TWFE or DiD-DR, demonstrating CFFE’s capacity to uncover nuanced heterogeneity (Souto et al., 14 May 2025).
8. Assumptions, Advantages, and Limitations
CFFE and DiD-BCF rely on parallel trends (unconditional or conditional), SUTVA, and no anticipation. They offer direct identification of CATE, GATE, and group/event-time effects, flexible nonlinear modeling, and full posterior inference capabilities. The PTA-based reparameterization in DiD-BCF improves identifiability and mixing in MCMC, isolates treatment periods, and guards against bias from pre-treatment data.
Computational complexity is a limitation for large panels, and for DiD-BCF, efficacy depends on correct specification of PTA and hyperparameter choices (Souto et al., 14 May 2025). A plausible implication is that further methodological work on scalable Bayesian panel forests may be beneficial.
Causal Forests with Fixed Effects constitute a unified, robust framework for granular, heterogeneous causal inference in complex panel environments, addressing key vulnerabilities of parametric and nonparametric alternatives.