- Introduced by
- Zheng, Aragam, Ravikumar & Xing
- Year
- 2018
- Type
- Continuous optimization algorithm for causal DAG discovery
- Family
- Causal discovery
What does it do?
NOTEARS ("DAGs with NO TEARS") is a causal structure learning method introduced by Zheng, Aragam, Ravikumar, and Xing at NeurIPS 2018.
It recasts the search for a directed acyclic graph (DAG) over observed variables as a continuous optimization problem over a weight matrix, so that gradient-based solvers can be used in place of search over discrete graphs. The method is defined for a linear structural equation model fitted to observational data.
The intuition behind the method
Learning a causal graph requires choosing which arrows to include while ensuring that no variable can cause itself through a chain of arrows, and the number of candidate graphs grows very quickly with the number of variables. NOTEARS represents the arrows as numerical weights and adds a smooth function of those weights that is zero exactly when the weighted graph has no cycles. Because this constraint is differentiable, the whole problem can be handled with standard numerical optimizers rather than a discrete search.
History
NOTEARS was introduced by Xun Zheng, Bryon Aragam, Pradeep Ravikumar, and Eric Xing at NeurIPS 2018, under the title "DAGs with NO TEARS: Continuous optimization for structure learning." Its central contribution is the smooth algebraic characterization of acyclicity used in the constraint above. Subsequent work has extended the same continuous framework to nonlinear models.
When to use it
Use NOTEARS when you have continuous observational data and want to discover a causal DAG among variables under a linear structural equation model (SEM) with Gaussian noise. The least-squares objective corresponds to a Gaussian likelihood for the linear SEM residuals, with residual variances treated as equal, so the Gaussian assumption is part of the model. It suits moderate to high-dimensional settings where combinatorial constraint-based methods become intractable. Key assumptions include linearity, causal sufficiency (no hidden confounders), and identifiability conditions. Whether edge directions are identified depends on conditions beyond the least-squares fit, and these should be checked for the data at hand. The method is not appropriate for discrete, count, or highly non-Gaussian data without extensions. Consider the PC algorithm or LiNGAM as alternatives depending on distributional assumptions.
Limitations and considerations
- The model is a linear structural equation model, so the method does not capture nonlinear causal mechanisms as defined here; nonlinear extensions of the continuous framework exist but are not part of the basic method.
- Causal sufficiency is assumed: if a latent variable confounds two observed variables, the estimated graph can contain edges that do not reflect direct causal effects, and the basic formulation does not model latent variables.
- The objective is non-convex in W, so the solver is not guaranteed to reach the global minimum and may return a local solution.
- Recovering the DAG requires thresholding the weights at ε, which adds a tuning choice that changes the trade-off between false positives and missed edges.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The combinatorial search over DAGs is replaced by optimization over a continuous matrix W, so standard gradient-based solvers can be applied directly.
- The acyclicity function h(W) has a closed form and is differentiable, which allows its gradient to be computed with automatic differentiation tools.
- All edge weights are estimated jointly under one global objective, whereas constraint-based methods such as the PC algorithm reach decisions through a sequence of separate conditional independence tests.
- The solver combines an off-the-shelf quasi-Newton method (L-BFGS) with a standard augmented Lagrangian loop, so implementations can reuse common optimization tooling.
Applications
- Exploratory search for candidate directed structure among continuous, approximately linear measurements, prior to confirmatory analysis.
- Generating hypotheses about which edges merit follow-up with interventional experiments or domain-specific tests.
- Serving as a baseline when comparing new continuous structure learners on linear Gaussian simulations.
How it works
How it works
The causal graph is represented by a weighted adjacency matrix W, where entry W_ji encodes the direct linear effect of variable j on variable i. The objective is a least-squares fit of the linear model X ≈ XW, measured by the Frobenius norm, plus an L1 penalty weighted by λ that pushes small weights toward zero.
Formula
\min_{W \in \mathbb{R}^{d \times d}} F(W) = \frac{1}{2n}\|X - XW\|_F^2 + \lambda \|W\|_1The acyclicity condition is h(W) = tr(exp(W ∘ W)) − d = 0, where ∘ denotes elementwise squaring and d is the number of variables. This function is zero exactly when the graph encoded by W has no directed cycles, and it is smooth, so its gradient can be computed with automatic differentiation.
Formula
h(W) = \mathrm{tr}\left(e^{W \circ W}\right) - d = 0The problem of minimizing F(W) subject to h(W) = 0 is handled by the augmented Lagrangian L_ρ(W, α) = F(W) + α h(W) + (ρ/2) h(W)². The multiplier α and the penalty weight ρ are updated across outer iterations to push h(W) toward zero, and each inner subproblem is minimized with a quasi-Newton method, L-BFGS.
Formula
L_{\rho}(W, \alpha) = F(W) + \alpha\, h(W) + \frac{\rho}{2}\, h(W)^2After optimization, an edge j → i is reported when the absolute value of the estimated weight Ŵ_ji exceeds the threshold ε. The resulting edge set is the estimated graph under the linear model. Because ε is applied directly to the weights, its meaning depends on the scale of the variables, and the edge set depends on ε as well as on λ.
Formula
\hat{G} = \{(j,i) : |\hat{W}_{ji}| > \epsilon\},\quad \hat{W} = \arg\min L_{\rho}(W,\alpha)Common pitfalls
- A small sparsity penalty λ yields dense graphs with many spurious edges, while a large λ can remove true edges; λ should be varied over a range and the resulting edge sets compared rather than fixed once.
- Applying NOTEARS to non-Gaussian, discrete, or count data departs from the Gaussian least-squares assumption under which the score is motivated, so the estimated graph should be interpreted with caution and not read as causal without further justification.
- The least-squares score by itself does not establish edge orientation: orientation depends on identifiability conditions of the underlying model, which the fit does not verify. Without such an argument, learned directions should be treated as model-conditional estimates rather than verified causal directions; LiNGAM's non-Gaussian noise assumption is one example of such a condition.
- Each iteration involves the matrix exponential in h(W), whose cost grows with the number of variables; for large graphs the runtime may become the practical constraint.
Frequently asked questions
Does NOTEARS guarantee recovery of the true DAG?
No. NOTEARS provides a continuous formulation of the acyclicity constraint and a Gaussian least-squares objective, but recovery of the true graph depends on the model assumptions holding and on the identifiability of edge directions under them. Under non-Gaussian noise, LiNGAM uses that assumption to identify orientations, whereas the least-squares formulation here does not provide that guarantee by itself.
How does NOTEARS differ from constraint-based methods like the PC algorithm?
The PC algorithm builds the graph from a sequence of conditional independence tests, so errors in individual tests can propagate to later decisions. NOTEARS instead optimizes one global score over the weight matrix subject to a smooth acyclicity constraint, which makes gradient-based computation possible but requires explicit linear and distributional assumptions.
Can NOTEARS handle nonlinear causal relationships?
The original NOTEARS is restricted to linear structural equation models. Nonlinear extensions of the same continuous framework replace the linear weight structure with more flexible functional forms, which allows nonlinear relationships while retaining the continuous acyclicity constraint, at the cost of greater model complexity and optimization difficulty.
Related methods
Sources
Zheng, X., Aragam, B., Ravikumar, P., & Xing, E. P. (2018). DAGs with NO TEARS: Continuous optimization for structure learning. Advances in Neural Information Processing Systems, 31.
Open publication reference